diff options
author | Harley Acheson <harley.acheson@gmail.com> | 2021-10-21 21:17:38 +0300 |
---|---|---|
committer | Harley Acheson <harley.acheson@gmail.com> | 2021-10-21 21:17:38 +0300 |
commit | 65490e62708c6bb0c03d9c73fd7179fdf71355a5 (patch) | |
tree | da3d19d16a745c1960acf89aabd9ab57fbc2bdc0 /source/blender | |
parent | 3858bf5c6fb4b40f6dc09312372d79e797da3750 (diff) |
Fix T92371: Move AZONE_REGION When Overlapped
Overlapped regions have transparent backgrounds, so when placing
AZONE_REGION we need to move them in to the content edge.
See D12956 for details and examples.
Differential Revision: https://developer.blender.org/D12956
Reviewed by Hans Goudey
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/screen/area.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 54727cc79f1..9e179dad2e8 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -972,29 +972,33 @@ static void fullscreen_azone_init(ScrArea *area, ARegion *region) #define AZONEPAD_ICON (0.45f * U.widget_unit) static void region_azone_edge(AZone *az, ARegion *region) { + /* If region is overlapped (transparent background), move AZone to content. + * Note this is an arbitrary amount that matches nicely with numbers elswhere. */ + int overlap_padding = (region->overlap) ? (int)(0.4f * U.widget_unit) : 0; + switch (az->edge) { case AE_TOP_TO_BOTTOMRIGHT: az->x1 = region->winrct.xmin; - az->y1 = region->winrct.ymax - AZONEPAD_EDGE; + az->y1 = region->winrct.ymax - AZONEPAD_EDGE - overlap_padding; az->x2 = region->winrct.xmax; - az->y2 = region->winrct.ymax + AZONEPAD_EDGE; + az->y2 = region->winrct.ymax + AZONEPAD_EDGE - overlap_padding; break; case AE_BOTTOM_TO_TOPLEFT: az->x1 = region->winrct.xmin; - az->y1 = region->winrct.ymin + AZONEPAD_EDGE; + az->y1 = region->winrct.ymin + AZONEPAD_EDGE + overlap_padding; az->x2 = region->winrct.xmax; - az->y2 = region->winrct.ymin - AZONEPAD_EDGE; + az->y2 = region->winrct.ymin - AZONEPAD_EDGE + overlap_padding; break; case AE_LEFT_TO_TOPRIGHT: - az->x1 = region->winrct.xmin - AZONEPAD_EDGE; + az->x1 = region->winrct.xmin - AZONEPAD_EDGE + overlap_padding; az->y1 = region->winrct.ymin; - az->x2 = region->winrct.xmin + AZONEPAD_EDGE; + az->x2 = region->winrct.xmin + AZONEPAD_EDGE + overlap_padding; az->y2 = region->winrct.ymax; break; case AE_RIGHT_TO_TOPLEFT: - az->x1 = region->winrct.xmax + AZONEPAD_EDGE; + az->x1 = region->winrct.xmax + AZONEPAD_EDGE - overlap_padding; az->y1 = region->winrct.ymin; - az->x2 = region->winrct.xmax - AZONEPAD_EDGE; + az->x2 = region->winrct.xmax - AZONEPAD_EDGE - overlap_padding; az->y2 = region->winrct.ymax; break; } |