[Bf-blender-cvs] [a8eb95c] master: Fix T39597: Missing entries in VSE Preview menu
Peter Schlaile
noreply at git.blender.org
Sun Apr 27 22:59:46 CEST 2014
Commit: a8eb95c4e9d680caa2904405504a27b301a57db0
Author: Peter Schlaile
Date: Sun Apr 27 22:59:30 2014 +0200
https://developer.blender.org/rBa8eb95c4e9d680caa2904405504a27b301a57db0
Fix T39597: Missing entries in VSE Preview menu
This adds some view ratios in the video sequencer menu, based (copied) on the UV/Image Editor. It also fixes the inverted ratio issue reported in the same task.
Reviewers: #video_sequencer, #user_interface, schlaile
Reviewed By: schlaile
CC: jta, dingto, sergey, schlaile
Differential Revision: https://developer.blender.org/D447
===================================================================
M release/scripts/startup/bl_ui/space_sequencer.py
M source/blender/editors/space_sequencer/sequencer_edit.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_sequencer.py b/release/scripts/startup/bl_ui/space_sequencer.py
index 0ce095d..b77078b 100644
--- a/release/scripts/startup/bl_ui/space_sequencer.py
+++ b/release/scripts/startup/bl_ui/space_sequencer.py
@@ -160,7 +160,16 @@ class SEQUENCER_MT_view(Menu):
if st.view_type in {'PREVIEW', 'SEQUENCER_PREVIEW'}:
layout.operator_context = 'INVOKE_REGION_PREVIEW'
layout.operator("sequencer.view_all_preview", text="Fit preview in window")
- layout.operator("sequencer.view_zoom_ratio", text="Show preview 1:1").ratio = 1.0
+
+ layout.separator()
+
+ ratios = ((1, 8), (1, 4), (1, 2), (1, 1), (2, 1), (4, 1), (8, 1))
+
+ for a, b in ratios:
+ layout.operator("sequencer.view_zoom_ratio", text=iface_("Zoom %d:%d") % (a, b), translate=False).ratio = a / b
+
+ layout.separator()
+
layout.operator_context = 'INVOKE_DEFAULT'
# # XXX, invokes in the header view
diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c
index f14eb2f..9b15036 100644
--- a/source/blender/editors/space_sequencer/sequencer_edit.c
+++ b/source/blender/editors/space_sequencer/sequencer_edit.c
@@ -2296,7 +2296,7 @@ static int sequencer_view_zoom_ratio_exec(bContext *C, wmOperator *op)
float facx = BLI_rcti_size_x(&v2d->mask) / winx;
float facy = BLI_rcti_size_y(&v2d->mask) / winy;
- BLI_rctf_resize(&v2d->cur, floorf(winx * facx * ratio + 0.5f), floorf(winy * facy * ratio + 0.5f));
+ BLI_rctf_resize(&v2d->cur, floorf(winx * facx / ratio + 0.5f), floorf(winy * facy / ratio + 0.5f));
ED_region_tag_redraw(CTX_wm_region(C));
More information about the Bf-blender-cvs
mailing list