Images always drawing on top of shapes in canvas
Is your issue REALLY a bug?
- [x] My issue is indeed a bug!
- [x] I am not crazy! I will not fill out this form just to ask a question or request a feature. Pinky promise.
Is there an existing issue for this?
- [x] I have searched the existing issues.
Is this issue related to iced?
- [x] My hardware is compatible and my graphics drivers are up-to-date.
What happened?
So i m trying to build an app where you can draw on top of images using primitive shapes. For some reason, the image is always drawn at the top and the primities are never visible. Yes, i tried a bunch of methods. Most important are
- two Geometry frames where the last one is the image one
- two Caches where the last one is the image one
What is the expected behavior?
I'd say the correct way to render in this instance is everything in the first layer then everything in the next layers, regardless of their types
Version
crates.io release
Operating System
Linux
Do you have any log output?
You can use the Stack widget or Renderer::with_layer to do z-ordering between different drawing primitives.
Aren't images always drawn on a separate top layer? Which is why you can't clip them?
No, stuff is drawn in the order quads -> triangles -> primitives -> images -> text within each layer.
No, stuff is drawn in the order
quads->triangles->primitives->images->textwithin each layer.
Doesn't that exactly mean that images are always draw after (therefor on top of) primitives? Or is my English failing me?
No, stuff is drawn in the order
quads->triangles->primitives->images->textwithin each layer.Doesn't that exactly mean that images are always draw after (therefor on top of) primitives? Or is my English failing me?
Within one layer, yes. You can add more layers (or just use the stack widget) to change that :)