diff options
author | Ton Roosendaal <ton@blender.org> | 2013-01-12 15:00:27 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2013-01-12 15:00:27 +0400 |
commit | 7db00f082603ea93384a627399e9d99ad02f8063 (patch) | |
tree | e90e83eb516ec34630abc983a06c795b390b842a /source/blender/editors | |
parent | 7a90af7b5a50bac5bb9fa6bf8ec785dac145a90c (diff) |
Usability:
Ancient annoying thing for zooming in 2d views: when a view was restricted to keep
aspect ratio, it only allowed vertical or horizontal MMB-drag zooms, depending
portrait or landscape size of editors. Same for trackpad and magic mouse.
Now vertical zoom drag always works for editors like buttons, nodes.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/interface/view2d_ops.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c index 9236800c16b..fbbcb650e68 100644 --- a/source/blender/editors/interface/view2d_ops.c +++ b/source/blender/editors/interface/view2d_ops.c @@ -952,6 +952,13 @@ static int view_zoomdrag_invoke(bContext *C, wmOperator *op, wmEvent *event) fac = 0.01f * (event->prevy - event->y); dy = fac * BLI_rctf_size_y(&v2d->cur) / 10.0f; + /* support trackpad zoom to always zoom entirely - the v2d code uses portrait or landscape exceptions */ + if (v2d->keepzoom & V2D_KEEPASPECT) { + if (fabsf(dx) > fabsf(dy)) + dy = dx; + else + dx = dy; + } RNA_float_set(op->ptr, "deltax", dx); RNA_float_set(op->ptr, "deltay", dy); @@ -1039,6 +1046,14 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event) } + /* support zoom to always zoom entirely - the v2d code uses portrait or landscape exceptions */ + if (v2d->keepzoom & V2D_KEEPASPECT) { + if (fabsf(dx) > fabsf(dy)) + dy = dx; + else + dx = dy; + } + /* set transform amount, and add current deltas to stored total delta (for redo) */ RNA_float_set(op->ptr, "deltax", dx); RNA_float_set(op->ptr, "deltay", dy); |