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>2008-12-08 03:48:27 +0300
committerJoshua Leung <aligorith@gmail.com>2008-12-08 03:48:27 +0300
commit11e15bf68979670b2257814aa296886222b3ee40 (patch)
tree092d3b2da5171cefb92cb19db7b663293a0ee166 /source/blender/editors
parentaf52f24fe486bf045113cfcc0bd4def8ea5ac00a (diff)
View2D: Tweaks to make handles work better with no-clamping of bubble
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/view2d_ops.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index be4ba8a404e..d784b1c7743 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -875,9 +875,14 @@ static short mouse_in_scroller_handle(int mouse, int sc_min, int sc_max, int sh_
{
short in_min, in_max;
- /* firstly, check if 'bubble' fills entire scroller */
- // XXX this isn't so good for anim-editors...
- if ((sh_min <= sc_min) && (sh_max >= sc_max)) {
+ /* firstly, check if
+ * - 'bubble' fills entire scroller
+ * - 'bubble' completely out of view on either side
+ */
+ if ( ((sh_min <= sc_min) && (sh_max >= sc_max)) ||
+ ((sh_min <= sc_min) && (sh_max <= sc_max)) ||
+ ((sh_min >= sc_max) && (sh_max >= sc_max)) )
+ {
/* use midpoint to determine which handle to use (favour 'max' handle) */
if (mouse >= ((sc_max + sc_min) / 2))
return SCROLLHANDLE_MAX;
@@ -1157,7 +1162,7 @@ void UI_view2d_keymap(wmWindowManager *wm)
{
ui_view2d_operatortypes();
- /* pan/scroll operators */
+ /* pan/scroll */
WM_keymap_add_item(&wm->view2dkeymap, "ED_View2D_OT_view_pan", MIDDLEMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(&wm->view2dkeymap, "ED_View2D_OT_view_rightscroll", WHEELDOWNMOUSE, KM_ANY, KM_CTRL, 0);