1 /*
2  * Copyright 2018 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package androidx.compose.ui.graphics
18 
19 import androidx.compose.runtime.Immutable
20 
21 /**
22  * Styles to use for line joins.
23  *
24  * This only affects line joins for polygons drawn by [Canvas.drawPath] and rectangles, not points
25  * drawn as lines with [Canvas.drawPoints]. See [Paint.strokeJoin].
26  */
27 @Immutable
28 @kotlin.jvm.JvmInline
29 value class StrokeJoin internal constructor(@Suppress("unused") private val value: Int) {
30     companion object {
31         /** Joins between line segments form sharp corners. */
32         val Miter = StrokeJoin(0)
33 
34         /** Joins between line segments are semi-circular. */
35         val Round = StrokeJoin(1)
36 
37         /**
38          * Joins between line segments connect the corners of the butt ends of the line segments to
39          * give a beveled appearance.
40          */
41         val Bevel = StrokeJoin(2)
42     }
43 
toStringnull44     override fun toString() =
45         when (this) {
46             Miter -> "Miter"
47             Round -> "Round"
48             Bevel -> "Bevel"
49             else -> "Unknown"
50         }
51 }
52