[Bf-blender-cvs] [7eecf77f0b1] master: VSE: Fix handle size calculation

Richard Antalik noreply at git.blender.org
Thu Jul 1 23:38:53 CEST 2021


Commit: 7eecf77f0b1c6475a88911b1f871775388026404
Author: Richard Antalik
Date:   Thu Jul 1 23:16:37 2021 +0200
Branches: master
https://developer.blender.org/rB7eecf77f0b1c6475a88911b1f871775388026404

VSE: Fix handle size calculation

Handle width calculation was incorrect in drawing code. This caused
handles to be invisible when zoomed out.

After fixing math, handles become too large, so now they are constrained
to quarter of strip width, which feels more natural and represents
clickable area more closely.

`sequence_handle_size_get_clamped()` did not return size in pixels, but
in 2D-View space, this comment was corrected.

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

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

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

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 8341dbe6014..dc1a49e347d 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -453,13 +453,13 @@ static void drawmeta_contents(Scene *scene, Sequence *seqm, float x1, float y1,
   GPU_blend(GPU_BLEND_NONE);
 }
 
-/* Get handle width in pixels. */
+/* Get handle width in 2d-View space. */
 float sequence_handle_size_get_clamped(Sequence *seq, const float pixelx)
 {
   const float maxhandle = (pixelx * SEQ_HANDLE_SIZE) * U.pixelsize;
 
-  /* Ensure that handle is not wider, than half of strip. */
-  return min_ff(maxhandle, ((float)(seq->enddisp - seq->startdisp) / 2.0f) / pixelx);
+  /* Ensure that handle is not wider, than quarter of strip. */
+  return min_ff(maxhandle, ((float)(seq->enddisp - seq->startdisp) / 4.0f));
 }
 
 /* Draw a handle, on left or right side of strip. */



More information about the Bf-blender-cvs mailing list