Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/view2d.c
| Context not available. | |||||
| if (scrollers->hor_min > scrollers->hor_max) { | if (scrollers->hor_min > scrollers->hor_max) { | ||||
| scrollers->hor_min = scrollers->hor_max; | scrollers->hor_min = scrollers->hor_max; | ||||
| } | } | ||||
| /* prevent sliders from being too small, and disappearing */ | /* prevent sliders from being too small to grab */ | ||||
| if ((scrollers->hor_max - scrollers->hor_min) < V2D_SCROLLER_HANDLE_SIZE) { | if ((scrollers->hor_max - scrollers->hor_min) < V2D_MIN_SCROLLER_SIZE) { | ||||
| scrollers->hor_max = scrollers->hor_min + V2D_SCROLLER_HANDLE_SIZE; | scrollers->hor_max = scrollers->hor_min + V2D_MIN_SCROLLER_SIZE; | ||||
| CLAMP(scrollers->hor_max, hor.xmin + V2D_MIN_SCROLLER_SIZE, hor.xmax); | |||||
| CLAMP(scrollers->hor_max, hor.xmin + V2D_SCROLLER_HANDLE_SIZE, hor.xmax); | CLAMP(scrollers->hor_min, hor.xmin, hor.xmax - V2D_MIN_SCROLLER_SIZE); | ||||
| CLAMP(scrollers->hor_min, hor.xmin, hor.xmax - V2D_SCROLLER_HANDLE_SIZE); | |||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||
| if (scrollers->vert_min > scrollers->vert_max) { | if (scrollers->vert_min > scrollers->vert_max) { | ||||
| scrollers->vert_min = scrollers->vert_max; | scrollers->vert_min = scrollers->vert_max; | ||||
| } | } | ||||
| /* prevent sliders from being too small, and disappearing */ | /* prevent sliders from being too small to grab */ | ||||
| if ((scrollers->vert_max - scrollers->vert_min) < V2D_SCROLLER_HANDLE_SIZE) { | if ((scrollers->vert_max - scrollers->vert_min) < V2D_MIN_SCROLLER_SIZE) { | ||||
| scrollers->vert_max = scrollers->vert_min + V2D_MIN_SCROLLER_SIZE; | |||||
| scrollers->vert_max = scrollers->vert_min + V2D_SCROLLER_HANDLE_SIZE; | CLAMP(scrollers->vert_max, vert.ymin + V2D_MIN_SCROLLER_SIZE, vert.ymax); | ||||
| CLAMP(scrollers->vert_min, vert.ymin, vert.ymax - V2D_MIN_SCROLLER_SIZE); | |||||
| CLAMP(scrollers->vert_max, vert.ymin + V2D_SCROLLER_HANDLE_SIZE, vert.ymax); | |||||
| CLAMP(scrollers->vert_min, vert.ymin, vert.ymax - V2D_SCROLLER_HANDLE_SIZE); | |||||
| } | } | ||||
| } | } | ||||
| Context not available. | |||||