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

WIP: get rid of clip_rect_margin #4294

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from
Draft

WIP: get rid of clip_rect_margin #4294

wants to merge 3 commits into from

Conversation

emilk
Copy link
Owner

@emilk emilk commented Mar 31, 2024

clip_rect_margin is an ugly hack that I rather not have.

This PR sets it to zero.

The margins of a window is now added to the inside of any ScrollArea in that window.

Why is there a clip_rect_margin?

Consider the problem of putting something with a frame (e.g. a button) inside a scroll area.

The button will be places so that the middle of its outer stroke is right on the edge of the scroll area.
This means only half of the stroke width will be visible. Buttons also grow when hovered, exacerbating the problem.

There are three potential solutions:

  • The existing clip_rect_margin, allowing widgets to "color outside the lines"
  • Add an inner margin to the inside of scroll areas (but this means things outside the scroll area are not aligned with things inside of it)
  • Fix CSS-like Border #4019

@emilk emilk added egui style visuals and theming labels Mar 31, 2024
@emilk
Copy link
Owner Author

emilk commented Apr 1, 2024

@varphone you may wanna test this to see I didn't break your custom window frames

@emilk emilk added this to the Next Major Release milestone Jun 26, 2024
@emilk emilk force-pushed the emilk/no-clip-margin branch from 781fde5 to 2b4aaf3 Compare July 31, 2024 16:46
@emilk emilk force-pushed the emilk/no-clip-margin branch from 2b4aaf3 to d74a769 Compare July 31, 2024 17:11
@emilk emilk removed this from the Next Major Release milestone Jul 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui style visuals and theming
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CSS-like Border
1 participant