Stroke
data class Stroke : DrawStyle
kotlin.Any | ||
↳ | androidx.compose.ui.graphics.drawscope.DrawStyle | |
↳ | androidx.compose.ui.graphics.drawscope.Stroke |
DrawStyle that provides information for drawing content with a stroke
Summary
Constants | |
---|---|
const Float |
Default miter length used in combination with joins |
const Float |
Width to indicate a hairline stroke of 1 pixel |
Public constructors | |
---|---|
<init>(width: Float = 0.0f, miter: Float = DefaultMiter, cap: StrokeCap = StrokeCap.Butt, join: StrokeJoin = StrokeJoin.Miter, pathEffect: PathEffect? = null) DrawStyle that provides information for drawing content with a stroke |
Properties | |
---|---|
StrokeCap |
Return the paint's Cap, controlling how the start and end of stroked lines and paths are treated. |
StrokeJoin |
Set's the treatment where lines and curve segments join on a stroked path. |
Float |
Set the stroke miter value. |
PathEffect? |
Effect to apply to the stroke, null indicates a solid stroke line is to be drawn |
Float |
Configure the width of the stroke in pixels |
Companion properties | |
---|---|
StrokeCap |
Default cap used for line endings |
StrokeJoin |
Default join style used for connections between line and curve segments |
Constants
DefaultMiter
const val DefaultMiter: Float
Default miter length used in combination with joins
Value: 4.0f
HairlineWidth
const val HairlineWidth: Float
Width to indicate a hairline stroke of 1 pixel
Value: 0.0f
Public constructors
<init>
Stroke(
width: Float = 0.0f,
miter: Float = DefaultMiter,
cap: StrokeCap = StrokeCap.Butt,
join: StrokeJoin = StrokeJoin.Miter,
pathEffect: PathEffect? = null)
DrawStyle that provides information for drawing content with a stroke
Properties
cap
val cap: StrokeCap
Return the paint's Cap, controlling how the start and end of stroked lines and paths are treated. The default is StrokeCap.Butt
join
val join: StrokeJoin
Set's the treatment where lines and curve segments join on a stroked path. The default is StrokeJoin.Miter
miter
val miter: Float
Set the stroke miter value. This is used to control the behavior of miter joins when the joins angle is sharp. This value must be >= 0.
pathEffect
val pathEffect: PathEffect?
Effect to apply to the stroke, null indicates a solid stroke line is to be drawn
Companion properties
DefaultJoin
val DefaultJoin: StrokeJoin
Default join style used for connections between line and curve segments