From 0262b939a04feaa31b1d072916c71d13a50b40b6 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Fri, 10 Oct 2025 18:18:58 +0200 Subject: [PATCH] Fix #147804: Alignment of Playhead parts With changes to the playhead to correctly draw when separated from the vertical line (for time stretching) some parts are slightly misaligned. This PR corrects the vertical alignment of the top of the triangular part to the number box. It also corrects horizontal alignment of the vertical line to be pixel-aligned based on the interior, not the shadow exterior. Pull Request: https://projects.blender.org/blender/blender/pulls/147825 --- source/blender/editors/animation/time_scrub_ui.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/editors/animation/time_scrub_ui.cc b/source/blender/editors/animation/time_scrub_ui.cc index 285b3ac5580..4dfbc0728c2 100644 --- a/source/blender/editors/animation/time_scrub_ui.cc +++ b/source/blender/editors/animation/time_scrub_ui.cc @@ -94,7 +94,7 @@ static void draw_current_frame(const Scene *scene, const float box_width = std::max(text_width + (2.0f * text_padding), box_min_width); const float box_margin = 2.0f * UI_SCALE_FAC; const float shadow_width = UI_SCALE_FAC; - const float tri_top = floor(scrub_region_rect->ymin + box_margin); + const float tri_top = ceil(scrub_region_rect->ymin + box_margin); const float tri_half_width = 6.0f * UI_SCALE_FAC; const float tri_height = 6.0f * UI_SCALE_FAC; rctf rect{}; @@ -123,8 +123,8 @@ static void draw_current_frame(const Scene *scene, immUnbindProgram(); /* Vertical line. */ - rect.xmin = floor(subframe_x - U.pixelsize - shadow_width); - rect.xmax = floor(subframe_x + U.pixelsize + 1.0f + shadow_width); + rect.xmin = floor(subframe_x - U.pixelsize) - shadow_width; + rect.xmax = floor(subframe_x + U.pixelsize + 1.0f) + shadow_width; rect.ymin = 0.0f; rect.ymax = ceil(scrub_region_rect->ymax - box_margin + shadow_width); UI_draw_roundbox_4fv_ex(&rect, fg_color, nullptr, 1.0f, bg_color, shadow_width, 0.0f);