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:
authorJoshua Leung <aligorith@gmail.com>2010-01-26 13:52:42 +0300
committerJoshua Leung <aligorith@gmail.com>2010-01-26 13:52:42 +0300
commit5a1603374c768d7a9c7d9cb4b05ca4098ca32537 (patch)
tree18fa86be7dd7870f77a944f329c2cc0112b99989 /source/blender/editors/interface/view2d.c
parente03bbf12c356c6f1f29095826293b3a074d77042 (diff)
Bugfix #19344: Using the scroll bar zoom widget doesn't work in some situations
Zoom widgets now only show if the scrollbar only shows scale markings (i.e. timegrids). --- Also removed an empty header file.
Diffstat (limited to 'source/blender/editors/interface/view2d.c')
-rw-r--r--source/blender/editors/interface/view2d.c28
1 files changed, 25 insertions, 3 deletions
diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c
index a6c37f689c5..b14dc5a03b6 100644
--- a/source/blender/editors/interface/view2d.c
+++ b/source/blender/editors/interface/view2d.c
@@ -1605,9 +1605,20 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
state= (v2d->scroll_ui & V2D_SCROLL_H_ACTIVE)?UI_SCROLL_PRESSED:0;
- if (!(v2d->keepzoom & V2D_LOCKZOOM_X) && (slider.xmax - slider.xmin > V2D_SCROLLER_HANDLE_SIZE))
+ /* show zoom handles if:
+ * - zooming on x-axis is allowed (no scroll otherwise)
+ * - slider bubble is large enough (no overdraw confusion)
+ * - scale is shown on the scroller
+ * (workaround to make sure that button windows don't show these,
+ * and only the time-grids with their zoomability can do so)
+ */
+ if ((v2d->keepzoom & V2D_LOCKZOOM_X)==0 &&
+ (v2d->scroll & V2D_SCROLL_SCALE_HORIZONTAL) &&
+ (slider.xmax - slider.xmin > V2D_SCROLLER_HANDLE_SIZE))
+ {
state |= UI_SCROLL_ARROWS;
-
+ }
+
uiWidgetScrollDraw(&wcol, &hor, &slider, state);
}
@@ -1702,8 +1713,19 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v
state= (v2d->scroll_ui & V2D_SCROLL_V_ACTIVE)?UI_SCROLL_PRESSED:0;
- if (!(v2d->keepzoom & V2D_LOCKZOOM_Y) && (slider.ymax - slider.ymin > V2D_SCROLLER_HANDLE_SIZE))
+ /* show zoom handles if:
+ * - zooming on y-axis is allowed (no scroll otherwise)
+ * - slider bubble is large enough (no overdraw confusion)
+ * - scale is shown on the scroller
+ * (workaround to make sure that button windows don't show these,
+ * and only the time-grids with their zoomability can do so)
+ */
+ if ((v2d->keepzoom & V2D_LOCKZOOM_Y)==0 &&
+ (v2d->scroll & V2D_SCROLL_SCALE_VERTICAL) &&
+ (slider.ymax - slider.ymin > V2D_SCROLLER_HANDLE_SIZE))
+ {
state |= UI_SCROLL_ARROWS;
+ }
uiWidgetScrollDraw(&wcol, &vert, &slider, state);
}