Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/screen/area.c
| Context not available. | |||||
| } | } | ||||
| const float coords[4][4] = { | const float coords[4][4] = { | ||||
| /* Bottom-left. */ | [AC_BOTTOMLEFT] = | ||||
| {area->totrct.xmin - U.pixelsize, | {area->totrct.xmin - U.pixelsize, | ||||
| area->totrct.ymin - U.pixelsize, | area->totrct.ymin - U.pixelsize, | ||||
| area->totrct.xmin + AZONESPOTW, | area->totrct.xmin + AZONESPOTW, | ||||
| area->totrct.ymin + AZONESPOTH}, | area->totrct.ymin + AZONESPOTH}, | ||||
| /* Bottom-right. */ | [AC_BOTTOMRIGHT] = | ||||
| {area->totrct.xmax - AZONESPOTW, | {area->totrct.xmax - AZONESPOTW, | ||||
| area->totrct.ymin - U.pixelsize, | area->totrct.ymin - U.pixelsize, | ||||
| area->totrct.xmax + U.pixelsize, | area->totrct.xmax + U.pixelsize, | ||||
| area->totrct.ymin + AZONESPOTH}, | area->totrct.ymin + AZONESPOTH}, | ||||
| /* Top-left. */ | [AC_TOPLEFT] = | ||||
| {area->totrct.xmin - U.pixelsize, | {area->totrct.xmin - U.pixelsize, | ||||
| area->totrct.ymax - AZONESPOTH, | area->totrct.ymax - AZONESPOTH, | ||||
| area->totrct.xmin + AZONESPOTW, | area->totrct.xmin + AZONESPOTW, | ||||
| area->totrct.ymax + U.pixelsize}, | area->totrct.ymax + U.pixelsize}, | ||||
| /* Top-right. */ | [AC_TOPRIGHT] = | ||||
| {area->totrct.xmax - AZONESPOTW, | {area->totrct.xmax - AZONESPOTW, | ||||
| area->totrct.ymax - AZONESPOTH, | area->totrct.ymax - AZONESPOTH, | ||||
| area->totrct.xmax + U.pixelsize, | area->totrct.xmax + U.pixelsize, | ||||
| area->totrct.ymax + U.pixelsize}, | area->totrct.ymax + U.pixelsize}, | ||||
| }; | }; | ||||
| for (int i = 0; i < 4; i++) { | for (int corner = 0; corner < 4; corner++) { | ||||
| /* can't click on bottom corners on OS X, already used for resizing */ | /* can't click on bottom corners on OS X, already used for resizing */ | ||||
| #ifdef __APPLE__ | #ifdef __APPLE__ | ||||
| if (!WM_window_is_fullscreen(win) && | if (!WM_window_is_fullscreen(win) && | ||||
| ((coords[i][0] == 0 && coords[i][1] == 0) || | ((coords[corner][0] == 0 && coords[corner][1] == 0) || | ||||
| (coords[i][0] == WM_window_pixels_x(win) && coords[i][1] == 0))) { | (coords[corner][0] == WM_window_pixels_x(win) && coords[corner][1] == 0))) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| #else | #else | ||||
| Context not available. | |||||
| AZone *az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone"); | AZone *az = (AZone *)MEM_callocN(sizeof(AZone), "actionzone"); | ||||
| BLI_addtail(&(area->actionzones), az); | BLI_addtail(&(area->actionzones), az); | ||||
| az->type = AZONE_AREA; | az->type = AZONE_AREA; | ||||
| az->x1 = coords[i][0]; | az->corner = corner; | ||||
| az->y1 = coords[i][1]; | az->x1 = coords[corner][0]; | ||||
| az->x2 = coords[i][2]; | az->y1 = coords[corner][1]; | ||||
| az->y2 = coords[i][3]; | az->x2 = coords[corner][2]; | ||||
| az->y2 = coords[corner][3]; | |||||
| 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); | ||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||