Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2012-08-23 18:49:20 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-08-23 18:49:20 +0400
commitf4ab3b9d8b613931956439a27044d4bae35ad3cd (patch)
tree0997667a780f7415a66d69c2d70ca2782dfe5f7e /source/blender
parent0dd42fd5138f19e22c347ac0a0817d8ba605a5c4 (diff)
sequencer zooms horizontal only from mouse wheel and plus buttons.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/editors/interface/view2d_ops.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/source/blender/editors/interface/view2d_ops.c b/source/blender/editors/interface/view2d_ops.c
index 84c3abf2ae2..cc2ca5c5475 100644
--- a/source/blender/editors/interface/view2d_ops.c
+++ b/source/blender/editors/interface/view2d_ops.c
@@ -672,13 +672,22 @@ static void view_zoomstep_exit(wmOperator *op)
/* this operator only needs this single callback, where it calls the view_zoom_*() methods */
static int view_zoomin_exec(bContext *C, wmOperator *op)
{
+ ScrArea *sa = CTX_wm_area(C);
+ short do_zoom_x = TRUE;
+ short do_zoom_y = TRUE;
+
/* check that there's an active region, as View2D data resides there */
if (!view_zoom_poll(C))
return OPERATOR_PASS_THROUGH;
+ /* default not to zoom the sequencer vertically */
+ if (sa && sa->spacetype == SPACE_SEQ) {
+ do_zoom_y = FALSE;
+ }
+
/* set RNA-Props - zooming in by uniform factor */
- RNA_float_set(op->ptr, "zoomfacx", 0.0375f);
- RNA_float_set(op->ptr, "zoomfacy", 0.0375f);
+ RNA_float_set(op->ptr, "zoomfacx", do_zoom_x ? 0.0375f : 0.0f);
+ RNA_float_set(op->ptr, "zoomfacy", do_zoom_y ? 0.0375f : 0.0f);
/* apply movement, then we're done */
view_zoomstep_apply(C, op);
@@ -729,13 +738,22 @@ static void VIEW2D_OT_zoom_in(wmOperatorType *ot)
/* this operator only needs this single callback, where it callsthe view_zoom_*() methods */
static int view_zoomout_exec(bContext *C, wmOperator *op)
{
+ ScrArea *sa = CTX_wm_area(C);
+ short do_zoom_x = TRUE;
+ short do_zoom_y = TRUE;
+
/* check that there's an active region, as View2D data resides there */
if (!view_zoom_poll(C))
return OPERATOR_PASS_THROUGH;
+ /* default not to zoom the sequencer vertically */
+ if (sa && sa->spacetype == SPACE_SEQ) {
+ do_zoom_y = FALSE;
+ }
+
/* set RNA-Props - zooming in by uniform factor */
- RNA_float_set(op->ptr, "zoomfacx", -0.0375f);
- RNA_float_set(op->ptr, "zoomfacy", -0.0375f);
+ RNA_float_set(op->ptr, "zoomfacx", do_zoom_x ? -0.0375f : 0.0f);
+ RNA_float_set(op->ptr, "zoomfacy", do_zoom_y ? -0.0375f : 0.0f);
/* apply movement, then we're done */
view_zoomstep_apply(C, op);