-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Add ScrollArea::content_margin
#7722
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
Conversation
|
Preview available at https://egui-pr-preview.github.io/pr/7722-emilkscroll-area-margin View snapshot changes at kitdiff |
lucasmerlin
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Neat!
| let mut content_ui = ui.new_child( | ||
| UiBuilder::new() | ||
| .ui_stack_info(UiStackInfo::new(UiKind::ScrollArea)) | ||
| .max_rect(content_max_rect), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't we just do content_max_rect - content_margin here, to avoid the extra nested child Ui?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh yeah - good idea!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
no, that affects inner_rect and so the scroll bars move…
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Too much hassle. I'll leave it as a future optimization 😞
clip_rect_margin#5605