From 7eecf77f0b1c6475a88911b1f871775388026404 Mon Sep 17 00:00:00 2001 From: Richard Antalik Date: Thu, 1 Jul 2021 23:16:37 +0200 Subject: 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. --- source/blender/editors/space_sequencer/sequencer_draw.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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. */ -- cgit v1.2.3