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

plots no longer start next line after filling available horizontal space since 0.23 #15

Open
rukai opened this issue Oct 8, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@rukai
Copy link
Contributor

rukai commented Oct 8, 2023

Possibly related to emilk/egui#3054

Describe the bug
In egui 0.22 plots put in a horizontal_wrapped ui wrap horizontally as expected.
image

Since egui 0.23 plots now continue on forever without wrapping, they are instead pushed off screen.
image

To Reproduce
Put this code in the eframe template

            ui.horizontal_wrapped(|ui| {
                for i in 0..10 {
                    let plot = Plot::new(format!("foo{i}"))
                        .legend(Legend::default())
                        .width(500.0)
                        .height(250.0)
                        .allow_scroll(false);

                    plot.show(ui, |_| {});
                }
            });

Desktop (please complete the following information):

  • Occurs on Arch linux Desktop
  • Occurs on firefox web
@rukai rukai added the bug Something isn't working label Oct 8, 2023
@YgorSouza
Copy link
Contributor

For the record, it works correctly if you use add_sized.

ui.horizontal_wrapped(|ui| {
    for i in 0..10 {
        let width = 500.0;
        let height = 250.0;
        let plot = Plot::new(format!("foo{i}"))
            .legend(Legend::default())
            .width(width)
            .height(height)
            .allow_scroll(false);
        ui.add_sized([width, height], |ui: &mut egui::Ui| {
            plot.show(ui, |_| {}).response
        });
    }
});

There's still a bug, of course, but that's an easy workaround if anyone needs it, and could be a clue for how to fix it in the plot itself.

@ryanavella
Copy link

I'm noticing you are also affected by #13, it's probably unrelated but worth noting.

@emilk emilk transferred this issue from emilk/egui Jul 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants