egui icon indicating copy to clipboard operation
egui copied to clipboard

WIP: get rid of clip_rect_margin

Open emilk opened this issue 1 year ago • 1 comments

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 https://github.com/emilk/egui/issues/4019

emilk avatar Mar 31 '24 19:03 emilk

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

emilk avatar Apr 01 '24 07:04 emilk