Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_handlers.c
- This file is larger than 256 KB, so syntax highlighting is disabled by default.
| Show First 20 Lines • Show All 4,187 Lines • ▼ Show 20 Lines | static uiButExtraOpIcon *ui_but_extra_operator_icon_mouse_over_get(uiBut *but, | ||||
| const float icon_size = 0.8f * BLI_rctf_size_y(&but->rect); /* ICON_SIZE_FROM_BUTRECT */ | const float icon_size = 0.8f * BLI_rctf_size_y(&but->rect); /* ICON_SIZE_FROM_BUTRECT */ | ||||
| int x = event->x, y = event->y; | int x = event->x, y = event->y; | ||||
| ui_window_to_block(data->region, but->block, &x, &y); | ui_window_to_block(data->region, but->block, &x, &y); | ||||
| if (!BLI_rctf_isect_pt(&but->rect, x, y)) { | if (!BLI_rctf_isect_pt(&but->rect, x, y)) { | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| /* Same as in 'widget_draw_extra_icons', icon padding from the right edge. */ | |||||
| xmax -= 0.2 * icon_size; | |||||
| /* Handle the padding space from the right edge as the last button. */ | |||||
| if (x > xmax) { | |||||
| return but->extra_op_icons.last; | |||||
| } | |||||
| /* Inverse order, from right to left. */ | /* Inverse order, from right to left. */ | ||||
| LISTBASE_FOREACH_BACKWARD (uiButExtraOpIcon *, op_icon, &but->extra_op_icons) { | LISTBASE_FOREACH_BACKWARD (uiButExtraOpIcon *, op_icon, &but->extra_op_icons) { | ||||
| if ((x > (xmax - icon_size)) && x < xmax) { | if ((x > (xmax - icon_size)) && x <= xmax) { | ||||
| return op_icon; | return op_icon; | ||||
| } | } | ||||
| xmax -= icon_size; | xmax -= icon_size; | ||||
| } | } | ||||
| return NULL; | return NULL; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 6,920 Lines • Show Last 20 Lines | |||||