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 being too short whenever there is horizontal margin #4005

Merged
merged 1 commit into from
Feb 10, 2024

Conversation

gweisert
Copy link
Contributor

@gweisert gweisert commented Feb 8, 2024

The allocated width is reduced by the horizontal margin inside show_content but the margin is already factored into the content_ui's rect.
This causes both text and frame (not shown here) to be 2.0 * margin.x too short.

Before:
image

After:
image-1
(*The blue rect is the TextEdit's (expected) final size.)

@emilk emilk changed the title Fix text_edit being too short whenever there is horizontal margin Fix TextEdit being too short whenever there is horizontal margin Feb 10, 2024
@emilk emilk added bug Something is broken layout Related to widget layout egui labels Feb 10, 2024
@emilk emilk merged commit 808dc01 into emilk:master Feb 10, 2024
21 of 22 checks passed
emilk pushed a commit that referenced this pull request Feb 10, 2024
…4005)

The allocated width is reduced by the horizontal margin inside
`show_content` but the margin is already factored into the content_ui's
rect.
This causes both text and frame (not shown here) to be `2.0 * margin.x`
too short.

Before:

![image](https://github.com/emilk/egui/assets/23122431/6a9a0264-3fc0-48b7-b462-82120ed47fcf)

After:

![image-1](https://github.com/emilk/egui/assets/23122431/ffef9edc-d571-4fca-96cf-c2e42e2f0057)
(*The blue rect is the TextEdit's (expected) final size.)

Co-authored-by: Georg Weisert <georg.weisert@freshx.de>
bu5hm4nn pushed a commit to bu5hm4nn/egui that referenced this pull request Feb 15, 2024
…milk#4005)

The allocated width is reduced by the horizontal margin inside
`show_content` but the margin is already factored into the content_ui's
rect.
This causes both text and frame (not shown here) to be `2.0 * margin.x`
too short.

Before:

![image](https://github.com/emilk/egui/assets/23122431/6a9a0264-3fc0-48b7-b462-82120ed47fcf)

After:

![image-1](https://github.com/emilk/egui/assets/23122431/ffef9edc-d571-4fca-96cf-c2e42e2f0057)
(*The blue rect is the TextEdit's (expected) final size.)

Co-authored-by: Georg Weisert <georg.weisert@freshx.de>
@gweisert gweisert deleted the bug_text_edit_width branch February 26, 2024 08:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is broken egui layout Related to widget layout
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants