Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Ebb <matt@mke3.net>2009-12-28 11:01:19 +0300
committerMatt Ebb <matt@mke3.net>2009-12-28 11:01:19 +0300
commitfa01205d9a01c39860b2793b8c9a3a20a425c82c (patch)
tree4360419113b7ef0d6e3d3a6c70c71bb6a7c6d0bc /source/blender/editors/interface/view2d.c
parentf9ee03f1b195a55ea8298783215d50d0ad4f3795 (diff)
Fix for [#19519] Dope sheet scrollbar goes out of bounds
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r--source/blender/editors/interface/view2d.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index 0bd0435362f..6cc344b891e 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1401,10 +1401,8 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
if ((scrollers->hor_max - scrollers->hor_min) < V2D_SCROLLER_HANDLE_SIZE) {
scrollers->hor_max= scrollers->hor_min + V2D_SCROLLER_HANDLE_SIZE;
- if(scrollers->hor_max > hor.xmax) {
- scrollers->hor_max= hor.xmax;
- scrollers->hor_min= MAX2(scrollers->hor_max - V2D_SCROLLER_HANDLE_SIZE, hor.xmin);
- }
+ CLAMP(scrollers->hor_max, hor.xmin+V2D_SCROLLER_HANDLE_SIZE, hor.xmax);
+ CLAMP(scrollers->hor_min, hor.xmin, hor.xmax-V2D_SCROLLER_HANDLE_SIZE);
}
/* check whether sliders can disappear */
@@ -1437,14 +1435,13 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
scrollers->vert_min= scrollers->vert_max;
/* prevent sliders from being too small, and disappearing */
if ((scrollers->vert_max - scrollers->vert_min) < V2D_SCROLLER_HANDLE_SIZE) {
+
scrollers->vert_max= scrollers->vert_min + V2D_SCROLLER_HANDLE_SIZE;
-
- if(scrollers->vert_max > vert.ymax) {
- scrollers->vert_max= vert.ymax;
- scrollers->vert_min= MAX2(scrollers->vert_max - V2D_SCROLLER_HANDLE_SIZE, vert.ymin);
- }
+
+ CLAMP(scrollers->vert_max, vert.ymin+V2D_SCROLLER_HANDLE_SIZE, vert.ymax);
+ CLAMP(scrollers->vert_min, vert.ymin, vert.ymax-V2D_SCROLLER_HANDLE_SIZE);
}
-
+
/* check whether sliders can disappear */
if(v2d->keeptot) {
if(fac1 <= 0.0f && fac2 >= 1.0f)