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

Auto sized Window does not get updated when app window is resized larger #4300

Open
msparkles opened this issue Apr 1, 2024 · 3 comments
Open
Labels
bug Something is broken

Comments

@msparkles
Copy link
Contributor

Describe the bug
When having a auto sized Window, texts get squished when the app window is small (see screenshots).
This is to be expected. However, it does not return to normal after the window is resized larger.

To Reproduce
Steps to reproduce the behavior:
0. This is just speculation, didn't actually test if this reprod would work.

  1. Make a auto_sized() Window
  2. Put in some texts
  3. Resize the application window smaller that the text is forced to wrap
  4. (Maybe you need to be on Linux/X11 too?? we can't verify this ourselves)
  5. Undo that resize, i.e. make the window larger
  6. The text doesn't get their wrapping, well, unwrapped

Expected behavior
For it not to do that, not to wrap the text even though there's enough space.

Screenshots
image
image
image

Desktop (please complete the following information):

  • OS: Arch Linux on X11
  • Egui Version: 0.27.1
@msparkles msparkles added the bug Something is broken label Apr 1, 2024
@emilk
Copy link
Owner

emilk commented Apr 1, 2024

I think this bug was introduced by #4199

Potential fixes:

  • When clamping window size to the viewport size we should not store it in the state.
  • Ognore the stored size for auto-sized windows

@rustbasic
Copy link
Contributor

@msparkles

I think using ScrollArea will help.

        egui::ScrollArea::both()                                                      
            .show(ui, |ui| {                                                          
                ui.horizontal_wrapped(|ui| {                                          
                    ui.label("test test test");                                       
                });                                                                   
            });                                                                       

@rustbasic
Copy link
Contributor

Potential fixes:

  • When clamping window size to the viewport size we should not store it in the state.
  • Ognore the stored size for auto-sized windows

This has nothing to do with #4199.

#4199 limits the maximum size to screen_rect(), and has no effect elsewhere.

However, #4199 has significant limitations, so for future development, I will submit a Pull Request with minimal limitations.

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

3 participants