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

Area: automatically request a repaint when showing up for the first time #866

Merged
merged 1 commit into from
Nov 7, 2021

Conversation

emilk
Copy link
Owner

@emilk emilk commented Nov 1, 2021

Closes #854

@m-ou-se can you please verify that this fixes your issue?

@emilk emilk force-pushed the area-auto-repaint-when-new branch from fde50b5 to 6026784 Compare November 2, 2021 19:43
@emilk emilk merged commit 6018c0e into master Nov 7, 2021
@emilk emilk deleted the area-auto-repaint-when-new branch November 7, 2021 20:14
@m-ou-se
Copy link

m-ou-se commented Nov 8, 2021

Hey, sorry for my late reply and thanks for the fix. I'll test it later today!

@m-ou-se
Copy link

m-ou-se commented Nov 8, 2021

It doesn't seem to change anything for me, and I might have misunderstood the exact problem behind the issue I reported in #854.

One problem appears to be that when using anything like ui.with_layout(Layout::top_down(Align::center), ..) inside a window/area, the area directly expands to the full screen width. The jumping I see then after the first redraw seems to be very small, maybe margin/padding on the left of the area disappearing only after it takes up the full screen width.

Whether ui.separator() or a centered layout should expand areas/containers like that is more of a fundamental question I suppose, and could only be changed by refactoring the whole min_rect/max_rect system. (I think?)

And another fundamental question around the problem I saw is whether egui should always keep redrawing until it reaches a steady state/fixed point. (Like LaTeX I suppose? ^^') (E.g. if something needs to be centered but turns out was drawn in the wrong place, always directly redraw with the new width information.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Automatically request repaint when Area size changed?
2 participants