Is it possible to combine multiple shapes and treat them as a single shape?
lordbenedikt opened this issue · 5 comments
lordbenedikt commented
I'm using this library to draw debug_shapes. Some of the shapes can't be represented by any of the provided shape types alone. Could they be combined though, it would perfectly work. Is it possible to do that?
zimond commented
You can use a PathBuilder
lordbenedikt commented
What if I need a shape that isn't made up of a continuous line i.e. an X?
zimond commented
@lordbenedikt you could just call .move_to()
, each call starts a new segment. This is identical to the concept of path building in the SVG spec.
lordbenedikt commented
@zimond thanks, I didn't know about that!
enaut commented
But it would be great to impl Add<PathBuilder> for PathBuilder
so I could predefine two unbuilt paths and combine the shapes. Or do I completely misunderstand the concept?