diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-10-08 21:41:27 +0400 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2012-10-08 21:41:27 +0400 |
commit | de6e47ab3dbe46f1d5ba3e1eef27f14c5b9ccccb (patch) | |
tree | 3f09522cdc7d08196ccc4fd4437be2278d686456 | |
parent | 82310c2f596972bc91a9ce192ae5f4bf43d4a625 (diff) |
Correction to zoom-t-mouse formula which was broken since view2d drag zoom refactoring
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 5ac20829480..eb2f6c62351 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -849,8 +849,8 @@ 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; @@ -868,8 +868,8 @@ 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; @@ -1045,13 +1045,13 @@ 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) { - RNA_float_set(op->ptr, "deltax", -dx); - RNA_float_set(op->ptr, "deltay", -dy); - } - else { - RNA_float_set(op->ptr, "deltax", dx); - RNA_float_set(op->ptr, "deltay", dy); + dx *= -1; + dy *= -1; } + + RNA_float_set(op->ptr, "deltax", dx); + RNA_float_set(op->ptr, "deltay", dy); + vzd->dx += dx; vzd->dy += dy; |