Hello, I'm trying to apply `PathEffect` to a line ...
# android
p
Hello, I'm trying to apply
PathEffect
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?
Relevant code:
Copy code
private 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