https://kotlinlang.org logo
#compose
Title
# compose
m

myanmarking

09/20/2023, 7:49 AM
Is there any way i can create a ‘WrapperPainter’, meaning, a painter that takes a painter, draw something behind and then draws the original painter. I have some repetitive vectores that the only difference is a circular background behind. I need to keep functionality so it must be a painter, otherwise i could just use .clip(CircleShape).background(Color.Black)
r

reactormonk

09/20/2023, 8:52 AM
Could you separate the static and dynamic part and layer them on top of each other with a
Box
? Not sure if that'd be faster.
m

myanmarking

09/20/2023, 9:16 AM
no i cant. I need a Painter solution
r

reactormonk

09/20/2023, 9:41 AM
How come?
a

Albert Chang

09/20/2023, 10:40 AM
Isn't it as simple as delegating every function to the original painter?
m

myanmarking

09/20/2023, 10:42 AM
no 😛 draw is protected
@reactormonk stop doubting my motives 😛 i don’t control the api. i need a painter. the alternative is repeating vectors
a

Albert Chang

09/20/2023, 10:46 AM
Okay I see. Maybe you can use the same way Coil is using.
👍 1
m

myanmarking

09/20/2023, 10:48 AM
uuu. that actually helps thanks!!! i was looking for something that i believed to be this
i could do it converting the vector to bitmap but that defeats the point. I prefer vectors. less memory footprint