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 :)
This commit is contained in:
@@ -946,10 +946,10 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
/* As we have only 1D information (magnify value), feed both axes
|
||||
* with magnify information that is stored in x axis
|
||||
*/
|
||||
fac = 0.01f * (event->x - event->prevx);
|
||||
fac = 0.01f * (event->prevx - event->x);
|
||||
dx = fac * BLI_rctf_size_x(&v2d->cur) / 10.0f;
|
||||
if (event->type == MOUSEPAN)
|
||||
fac = 0.01f * (event->y - event->prevy);
|
||||
fac = 0.01f * (event->prevy - event->y);
|
||||
dy = fac * BLI_rctf_size_y(&v2d->cur) / 10.0f;
|
||||
|
||||
RNA_float_set(op->ptr, "deltax", dx);
|
||||
|
@@ -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;
|
||||
}
|
||||
|
||||
|
@@ -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;
|
||||
|
@@ -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);
|
||||
|
@@ -464,7 +464,7 @@ static int image_view_zoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
UI_view2d_region_to_view(&ar->v2d, event->mval[0], event->mval[1], &location[0], &location[1]);
|
||||
|
||||
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;
|
||||
|
@@ -2101,16 +2101,15 @@ static int viewzoom_invoke(bContext *C, wmOperator *op, wmEvent *event)
|
||||
}
|
||||
else {
|
||||
if (event->type == MOUSEZOOM || event->type == MOUSEPAN) {
|
||||
/* Bypass Zoom invert flag for track pads (pass FALSE always) */
|
||||
|
||||
if (U.uiflag & USER_ZOOM_HORIZ) {
|
||||
vod->origx = vod->oldx = event->x;
|
||||
viewzoom_apply(vod, event->prevx, event->prevy, USER_ZOOM_DOLLY, (U.uiflag & USER_ZOOM_INVERT) == 0);
|
||||
viewzoom_apply(vod, event->prevx, event->prevy, USER_ZOOM_DOLLY, (U.uiflag & USER_ZOOM_INVERT) != 0);
|
||||
}
|
||||
else {
|
||||
/* Set y move = x move as MOUSEZOOM uses only x axis to pass magnification value */
|
||||
vod->origy = vod->oldy = vod->origy + event->x - event->prevx;
|
||||
viewzoom_apply(vod, event->prevx, event->prevy, USER_ZOOM_DOLLY, (U.uiflag & USER_ZOOM_INVERT) == 0);
|
||||
viewzoom_apply(vod, event->prevx, event->prevy, USER_ZOOM_DOLLY, (U.uiflag & USER_ZOOM_INVERT) != 0);
|
||||
}
|
||||
ED_view3d_depth_tag_update(vod->rv3d);
|
||||
|
||||
|
Reference in New Issue
Block a user