louiscad
02/16/2024, 12:04 AMPathEffect
can only be used with Stroke
or stroke-only drawing APIs, but Android Canvas supports path effects with Fill
.
For example, you can very easily round the tips of a triangle with PathEffect.cornerPathEffect(…)
, but Compose doesn't let you fill it.
Would it be possible to add an optional PathEffect
parameter to Fill
?
It should be possible to keep binary and source compatibility by turning object Fill : DrawStyle()
into that:
class Fill(val pathEffect: PathEffect?) : DrawStyle() {
companion object INSTANCE = Fill(null)
}
Another possibility would be to introduce a third subclass named something like FillEffect
, though I don't like it as much, personally.
Edit: Submitted a feature request: https://issuetracker.google.com/issues/325449814