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:
authorTon Roosendaal <ton@blender.org>2013-01-06 15:16:49 +0400
committerTon Roosendaal <ton@blender.org>2013-01-06 15:16:49 +0400
commit16ca65e4a91bf49b77dc27d79779a35ed749bbf8 (patch)
treee1a6731bbabd50ec3fb19c7b5311977155a37ab1 /source/blender/editors/space_clip
parent27170d3e381adf514b01b4810665b870b030f882 (diff)
Solving nasty annoyance:
Trackpad zoom (swipe + CTRL) direction was inverted compared to MMB-drag or scrollwheel usage. In the 3D viewport it was OK, in all others not. Now the same physical gesture maps identical to zooming everywhere. Or to recap (with blender factory settings) Zooming in: - MMB-drag, move mouse towards screen - Scroll wheel, move finger towards screen - Magic Mouse, move finger towards screen - Trackpad 2-finger swipe: move fingers toward screen. To make this extra confusing: this is only consistent if you set your system to inperpret trackpad swipes as "inverted" (pan view left = swipe to right). This is a typical default, although Apple wants you to call this "Unnatural" :) Next commit will be testing on laptop if all pinch gestures zoom consistent. And following to that, a sensible user preference to map trackpad use for Blender yourself, to invert system defaults again. :) Blame and thanks goes to Sebastian Koenig, for his perseverance on getting this solved :)
Diffstat (limited to 'source/blender/editors/space_clip')
-rw-r--r--source/blender/editors/space_clip/clip_editor.c2
-rw-r--r--source/blender/editors/space_clip/clip_ops.c4
-rw-r--r--source/blender/editors/space_clip/space_clip.c1
3 files changed, 4 insertions, 3 deletions
diff --git a/source/blender/editors/space_clip/clip_editor.c b/source/blender/editors/space_clip/clip_editor.c
index 3088243d266..04154a27b74 100644
--- a/source/blender/editors/space_clip/clip_editor.c
+++ b/source/blender/editors/space_clip/clip_editor.c
@@ -82,7 +82,7 @@ int ED_space_clip_view_clip_poll(bContext *C)
{
SpaceClip *sc = CTX_wm_space_clip(C);
- if (sc && sc->clip) {
+ if (sc) {
return sc->view == SC_VIEW_CLIP;
}
diff --git a/source/blender/editors/space_clip/clip_ops.c b/source/blender/editors/space_clip/clip_ops.c
index caf28e1c551..26bae6e3978 100644
--- a/source/blender/editors/space_clip/clip_ops.c
+++ b/source/blender/editors/space_clip/clip_ops.c
@@ -515,10 +515,10 @@ static int view_zoom_exec(bContext *C, wmOperator *op)
static int view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
{
- if (event->type == MOUSEZOOM) {
+ if (event->type == MOUSEZOOM || event->type == MOUSEPAN) {
float delta, factor;
- delta = event->x - event->prevx + event->y - event->prevy;
+ delta = event->prevx - event->x + event->prevy - event->y;
if (U.uiflag & USER_ZOOM_INVERT)
delta *= -1;
diff --git a/source/blender/editors/space_clip/space_clip.c b/source/blender/editors/space_clip/space_clip.c
index dc7b6d77c9e..9d0421349d7 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -587,6 +587,7 @@ static void clip_keymap(struct wmKeyConfig *keyconf)
WM_keymap_add_item(keymap, "CLIP_OT_view_zoom", MIDDLEMOUSE, KM_PRESS, KM_CTRL, 0);
WM_keymap_add_item(keymap, "CLIP_OT_view_zoom", MOUSEZOOM, 0, 0, 0);
+ WM_keymap_add_item(keymap, "CLIP_OT_view_zoom", MOUSEPAN, 0, KM_CTRL, 0);
WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_in", WHEELINMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_out", WHEELOUTMOUSE, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, "CLIP_OT_view_zoom_in", PADPLUSKEY, KM_PRESS, 0, 0);