Correction to zoom-t-mouse formula which was broken since view2d drag zoom refactoring
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user