Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/area.c
| Show First 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | |||||
| BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); | BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); | ||||
| } | } | ||||
| #define AZONEPAD_EDGE (0.1f * U.widget_unit) | #define AZONEPAD_EDGE (0.1f * U.widget_unit) | ||||
| #define AZONEPAD_ICON (0.45f * U.widget_unit) | #define AZONEPAD_ICON (0.45f * U.widget_unit) | ||||
| static void region_azone_edge(AZone *az, ARegion *region) | 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. */ | |||||
HooglyBoogly: `const`
Also, the comment could note that 0.4 is an arbitrary number that happens to line up… | |||||
| int overlap_padding = (region->overlap) ? (int)(0.4f * U.widget_unit) : 0; | |||||
| switch (az->edge) { | switch (az->edge) { | ||||
| case AE_TOP_TO_BOTTOMRIGHT: | case AE_TOP_TO_BOTTOMRIGHT: | ||||
| az->x1 = region->winrct.xmin; | 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->x2 = region->winrct.xmax; | ||||
| az->y2 = region->winrct.ymax + AZONEPAD_EDGE; | az->y2 = region->winrct.ymax + AZONEPAD_EDGE - overlap_padding; | ||||
| break; | break; | ||||
| case AE_BOTTOM_TO_TOPLEFT: | case AE_BOTTOM_TO_TOPLEFT: | ||||
| az->x1 = region->winrct.xmin; | 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->x2 = region->winrct.xmax; | ||||
| az->y2 = region->winrct.ymin - AZONEPAD_EDGE; | az->y2 = region->winrct.ymin - AZONEPAD_EDGE + overlap_padding; | ||||
| break; | break; | ||||
| case AE_LEFT_TO_TOPRIGHT: | 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->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; | az->y2 = region->winrct.ymax; | ||||
| break; | break; | ||||
| case AE_RIGHT_TO_TOPLEFT: | 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->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; | az->y2 = region->winrct.ymax; | ||||
| break; | break; | ||||
| } | } | ||||
| BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); | BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2); | ||||
| } | } | ||||
| /* region already made zero sized, in shape of edge */ | /* region already made zero sized, in shape of edge */ | ||||
| static void region_azone_tab_plus(ScrArea *area, AZone *az, ARegion *region) | static void region_azone_tab_plus(ScrArea *area, AZone *az, ARegion *region) | ||||
| ▲ Show 20 Lines • Show All 92 Lines • Show Last 20 Lines | |||||
const
Also, the comment could note that 0.4 is an arbitrary number that happens to line up with numbers elsewhere.