pierbezuhoff
11/22/2024, 6:30 AMPathEffect
to a line segment drawn on Canvas
, but it apparently clips the effect to the line's bounding rectangle. So for near-vertical and near-horizontal lines the path effect vanishes (the bounding rect is very thin). Any ways around it?pierbezuhoff
11/22/2024, 6:33 AMprivate val HAIR_PATH_EFFECT =
PathEffect.stampedPathEffect(
shape = HAIR_PATH,
advance = HAIR_SPACING,
phase = 0f,
style = StampedPathEffectStyle.Rotate
)
private val ARROWED_PATH_EFFECT =
PathEffect.stampedPathEffect(
shape = ARROW_SHAPE,
advance = ARROW_SPACING,
phase = ARROW_SPACING/2,
style = StampedPathEffectStyle.Rotate
)
... (in DrawScope)
drawPath(linePath, color, style = Stroke(pathEffect = HAIR_PATH_EFFECT))
drawPath(linePath, color, style = Stroke(pathEffect = ARROWED_PATH_EFFECT))
also i noticed that on compose-desktop it displays fine, without clipping to the bounding rect