[Bf-blender-cvs] [68a08460219] master: Fix T102657: Unable to add strip to new channel

Richard Antalik noreply at git.blender.org
Tue Nov 29 19:55:39 CET 2022


Commit: 68a08460219ac63a956cccd070bbd4eccfcf89bc
Author: Richard Antalik
Date:   Tue Nov 29 19:49:40 2022 +0100
Branches: master
https://developer.blender.org/rB68a08460219ac63a956cccd070bbd4eccfcf89bc

Fix T102657: Unable to add strip to new channel

This is usability improvement, rather than bugfix. By default, height of
VSE timeline is clamped to 7 channels, unless more are added. But adding
new strip is not intuitive, since user can't scroll up due to clamping.

Clamp timeline height to n+1 used channels, so there is always 1 free
channel visible.

===================================================================

M	source/blender/editors/space_sequencer/space_sequencer.c

===================================================================

diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c
index 1d20926d16c..2f8ee37be2a 100644
--- a/source/blender/editors/space_sequencer/space_sequencer.c
+++ b/source/blender/editors/space_sequencer/space_sequencer.c
@@ -565,7 +565,7 @@ static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
 
   /* Initialize default view with 7 channels, that are visible even if empty. */
   rctf strip_boundbox;
-  BLI_rctf_init(&strip_boundbox, 0.0f, 0.0f, 1.0f, 7.0f);
+  BLI_rctf_init(&strip_boundbox, 0.0f, 0.0f, 1.0f, 6.0f);
   SEQ_timeline_expand_boundbox(scene, ed->seqbasep, &strip_boundbox);
 
   /* Clamp Y max. Scrubbing area height must be added, so strips aren't occluded. */
@@ -574,8 +574,8 @@ static void sequencer_main_clamp_view(const bContext *C, ARegion *region)
   const float pixel_view_size_y = BLI_rctf_size_y(&v2d->cur) / BLI_rcti_size_y(&v2d->mask);
   const float scrub_bar_height = BLI_rcti_size_y(&scrub_rect) * pixel_view_size_y;
 
-  /* Channel n has range of <n, n+1>. */
-  strip_boundbox.ymax += 1.0f + scrub_bar_height;
+  /* Channel n has range of <n, n+1>, +1 for empty channel. */
+  strip_boundbox.ymax += 2.0f + scrub_bar_height;
 
   /* Clamp Y min. Scroller and marker area height must be added, so strips aren't occluded. */
   float scroll_bar_height = v2d->hor.ymax * pixel_view_size_y;



More information about the Bf-blender-cvs mailing list