Sequencer: Implement zoom-to-fit view mode

In this mode the preview image is always using the most of the preview
area space: it is scaled to fit, preserving aspect ratio. This makes it
possible to always have maximum of the preview region even after resize
of other areas.

This mode is enabled by default, is available in the View -> Zoom to Fit
menu. It is enabled when View All (Home key) is used, and is disabled
when manual navigation ([panning, zooming) is performed.

There is no versioning code, which means existing files will open as-is,
but new projects will have this option enabled.

Ref T78987

Maniphest Tasks: T78987

Differential Revision: https://developer.blender.org/D8549
This commit is contained in:
2020-08-12 11:05:40 +02:00
parent 0df28e8c20
commit 6fe609d4c3
6 changed files with 34 additions and 3 deletions

View File

@@ -4796,6 +4796,12 @@ static void rna_def_space_sequencer(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Waveform Displaying", "How Waveforms are drawn");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
prop = RNA_def_property(srna, "zoom_to_fit", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", SEQ_ZOOM_TO_FIT);
RNA_def_property_ui_text(
prop, "Zoom to Fit", "Automatically zoom preview image to make it fully fit the region");
RNA_def_property_update(prop, NC_SPACE | ND_SPACE_SEQUENCER, NULL);
prop = RNA_def_property(srna, "show_overexposed", PROP_INT, PROP_NONE);
RNA_def_property_int_sdna(prop, NULL, "zebra");
RNA_def_property_ui_text(prop, "Show Overexposed", "Show overexposed areas with zebra stripes");