Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Antalik <richardantalik@gmail.com>2021-07-02 00:16:37 +0300
committerRichard Antalik <richardantalik@gmail.com>2021-07-02 00:38:06 +0300
commit7eecf77f0b1c6475a88911b1f871775388026404 (patch)
treee23c30895dd3fb32116b23d9a268fe96cb1a8fa3
parentfd1fec5600287cd47e5fcf0affe16d712ba85fbe (diff)
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.
-rw-r--r--source/blender/editors/space_sequencer/sequencer_draw.c6
1 files 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. */