Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scene doesn't nest #5682

Open
Masterchef365 opened this issue Feb 5, 2025 · 0 comments
Open

Scene doesn't nest #5682

Masterchef365 opened this issue Feb 5, 2025 · 0 comments
Labels
bug Something is broken

Comments

@Masterchef365
Copy link

Describe the bug
I'm very aware that this is a niche use-case, and must admit that I don't have an immediate application for it, but: nesting Scene doesn't provide the desired effect.

To Reproduce
Steps to reproduce the behavior (tested on master 0db56dc):

use eframe::egui::{self, Rect};

fn main() -> eframe::Result {
    let mut scene_rect = Rect::ZERO;
    let mut inner_rect = Rect::ZERO;

    eframe::run_simple_native("My egui App", Default::default(), move |ctx, _frame| {

        egui::CentralPanel::default().show(ctx, |ui| {
            ui.label("Outside the scenes");

            egui::Scene::new().show(ui, &mut scene_rect, |ui| {
                ui.label("Inside first scene");

                egui::Frame::canvas(ui.style()).show(ui, |ui| {
                    egui::Scene::new().show(ui, &mut inner_rect, |ui| {
                        ui.label("I'm in a nested scene!");
                    });
                });

            });
        });
    })
}

Expected behavior
Ideally, the contents of the sub-scene should be be scaled, transformed, and clipped appropriately.

Screenshots
Image

Additional context
Again, I don't have an immediate use-case for this so it probably shouldn't be a priority.

@Masterchef365 Masterchef365 added the bug Something is broken label Feb 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken
Projects
None yet
Development

No branches or pull requests

1 participant