⚠️ Frame now includes stroke width as part of padding - #5575
Merged
Merged
Conversation
|
Preview available at https://egui-pr-preview.github.io/pr/5575-emilkborder |
emilk
marked this pull request as ready for review
January 3, 2025 13:42
Frame now included stroke width as part of paddingFrame now includes stroke width as part of padding
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Border#4019Framenow includes the width of the stroke as part of its size. From the new docs:FramedocsThe total (outer) size of a frame is
content_size + inner_margin + 2*stroke.width + outer_margin.Everything within the stroke is filled with the fill color (if any).
The four rectangles, from inside to outside, are:
content_rect: the rectangle that is made available to the inner [Ui] or widget.fill_rect: the rectangle that is filled with the fill color (inside the stroke, if any).widget_rect: is the interactive part of the widget (what sense clicks etc).outer_rect: what is allocated in the outer [Ui], and is what is returned by [Response::rect].Notes
This required rewriting a lot of the layout code for
egui::Window, which was a massive pain. But now the window margin and stroke width is properly accounted for everywhere.