diff options
Diffstat (limited to 'source/blender/editors/interface/view2d_ops.c')
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 8be2667a015..12e04d392b4 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -827,6 +827,11 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op) dx = RNA_float_get(op->ptr, "deltax"); dy = RNA_float_get(op->ptr, "deltay"); + if (U.uiflag & USER_ZOOM_INVERT) { + dx *= -1; + dy *= -1; + } + /* continuous zoom shouldn't move that fast... */ if (U.viewzoom == USER_ZOOM_CONT) { // XXX store this setting as RNA prop? double time = PIL_check_seconds_timer(); @@ -849,12 +854,12 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op) float mval_faci = 1.0f - mval_fac; float ofs = (mval_fac * dx) - (mval_faci * dx); - v2d->cur.xmin -= ofs + dx; - v2d->cur.xmax -= ofs - dx; + v2d->cur.xmin += ofs + dx; + v2d->cur.xmax += ofs - dx; } else { - v2d->cur.xmin -= dx; - v2d->cur.xmax += dx; + v2d->cur.xmin += dx; + v2d->cur.xmax -= dx; } } } @@ -868,12 +873,12 @@ static void view_zoomdrag_apply(bContext *C, wmOperator *op) float mval_faci = 1.0f - mval_fac; float ofs = (mval_fac * dy) - (mval_faci * dy); - v2d->cur.ymin -= ofs + dy; - v2d->cur.ymax -= ofs - dy; + v2d->cur.ymin += ofs + dy; + v2d->cur.ymax += ofs - dy; } else { - v2d->cur.ymin -= dy; - v2d->cur.ymax += dy; + v2d->cur.ymin += dy; + v2d->cur.ymax -= dy; } } } @@ -941,7 +946,7 @@ 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->prevx - event->x); + fac = 0.01f * (event->x - event->prevx); dx = fac * BLI_rctf_size_x(&v2d->cur) / 10.0f; dy = fac * BLI_rctf_size_y(&v2d->cur) / 10.0f; @@ -1044,11 +1049,6 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event) } /* set transform amount, and add current deltas to stored total delta (for redo) */ - if (U.uiflag & USER_ZOOM_INVERT) { - dx *= -1; - dy *= -1; - } - RNA_float_set(op->ptr, "deltax", dx); RNA_float_set(op->ptr, "deltay", dy); |