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

Fix textedit intrinsic size metric #5275

Merged
merged 1 commit into from
Oct 28, 2024

Conversation

lucasmerlin
Copy link
Collaborator

@lucasmerlin lucasmerlin commented Oct 16, 2024

Since textedit is doing the justify layout calculation itself, we need to report the original desired_size as intrinsic size, instead of the value passed to allocate_space.

I wonder though, is it still necessary that the TextEdit does the justify calculation itself instead of relying on the ui layout to do it? As far as I understand it, justify should be handled by the ui.allocate_space call.

Copy link

Preview available at https://egui-pr-preview.github.io/pr/5275-fix-textedit-intrinsic-size
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

lucasmerlin added a commit to lucasmerlin/hello_egui that referenced this pull request Oct 16, 2024
@emilk
Copy link
Owner

emilk commented Oct 28, 2024

I wonder though, is it still necessary that the TextEdit does the justify calculation itself instead of relying on the ui layout to do it? As far as I understand it, justify should be handled by the ui.allocate_space call.

I think ui.allocate_space should be able to handle it, unless I'm missing something. Could just be legacy.

@emilk emilk merged commit 4e101d2 into emilk:master Oct 28, 2024
25 of 26 checks passed
hacknus pushed a commit to hacknus/egui that referenced this pull request Oct 30, 2024
Since textedit is doing the justify layout calculation itself, we need
to report the original desired_size as intrinsic size, instead of the
value passed to allocate_space.

I wonder though, is it still necessary that the TextEdit does the
justify calculation itself instead of relying on the ui layout to do it?
As far as I understand it, justify should be handled by the
ui.allocate_space call.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants