emilk / egui

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
https://www.egui.rs/
Apache License 2.0
20.61k stars 1.49k forks source link

Allow setting a layer as a sublayer of another #4690

Closed YgorSouza closed 5 days ago

YgorSouza commented 6 days ago

When the layers are reordered at the end of the frame, the sublayers are placed directly above their respective parents. This allows having Areas inside Windows, e.g., for the pan-zoom container.

YgorSouza commented 6 days ago

I don't know if this is the best API, but it is relatively simple and seems to solve the problem of the pan zoom demo being layered above everything.

https://github.com/emilk/egui/assets/43298013/b910950f-7362-4ba0-881c-10a63a5f2630

It does not solve the other problem mentioned in https://github.com/emilk/egui/issues/4128#issuecomment-2001977126.

emilk commented 5 days ago

Thanks!