UI: Improve region resize edge detection for transparent regions #109753

Merged
Julian Eisel merged 4 commits from JulianEisel/blender:temp-region-resize-edge-offset-fix into main 2023-07-10 12:53:48 +02:00

4 Commits

Author SHA1 Message Date
Julian Eisel 20ea9a1303 Address review comments 2023-07-10 12:52:10 +02:00
Julian Eisel d7cb2b6a5f Merge branch 'main' into temp-region-resize-edge-offset-fix 2023-07-10 12:47:44 +02:00
Julian Eisel d322993d50 Cleanup: Improve comments 2023-07-05 17:44:36 +02:00
Julian Eisel fb511f312f UI: Improve region resize edge detection for transparent regions
For overlapping regions, we currently offset the edge for resizing
regions a bit towards the contents. This makes sense for example in the
sidebar, where the region background is fully transparent by default,
and users expect the edge to be where the visible contents begin. This
was an issue in #104831 for two reasons:
- Although the region overlaps, we decided to make it fully opaque by
  default. The offset is still applied, making the edge detection feel
  broken.
- The offset would also be applied to header-like regions, where there
  is not much padding between the edge and the content. So the edge to
  resize the region would overlap buttons.

2 changes to address this:
- Only apply the offset if the region background is transparent-ish,
  with a rather arbitrary alpha threshold.
- Do not apply the offset for header-like regions.
2023-07-05 17:29:32 +02:00