[Bf-blender-cvs] [42b462ddd77] master: UI: improve timeline playhead scrubber drawing
Harley Acheson
noreply at git.blender.org
Thu May 9 19:55:56 CEST 2019
Commit: 42b462ddd77cb73ad4f39152fc5213c43bbf2d37
Author: Harley Acheson
Date: Thu May 9 19:28:31 2019 +0200
Branches: master
https://developer.blender.org/rB42b462ddd77cb73ad4f39152fc5213c43bbf2d37
UI: improve timeline playhead scrubber drawing
Minimum width, always centered on the vertical frame line, antialiased.
Differential Revision: https://developer.blender.org/D4830
===================================================================
M source/blender/editors/animation/anim_scrubbing.c
===================================================================
diff --git a/source/blender/editors/animation/anim_scrubbing.c b/source/blender/editors/animation/anim_scrubbing.c
index 507d48cad31..b0c9acff2ab 100644
--- a/source/blender/editors/animation/anim_scrubbing.c
+++ b/source/blender/editors/animation/anim_scrubbing.c
@@ -101,24 +101,34 @@ static void draw_current_frame(const Scene *scene,
char frame_str[64];
get_current_time_str(scene, display_seconds, current_frame, sizeof(frame_str), frame_str);
float text_width = UI_fontstyle_string_width(fstyle, frame_str);
- float box_width = text_width + 10 * UI_DPI_FAC;
+ float box_width = MAX2(text_width + 8 * UI_DPI_FAC, 24 * UI_DPI_FAC);
float box_padding = 3 * UI_DPI_FAC;
float bg_color[4];
- UI_GetThemeColor4fv(TH_CFRAME, bg_color);
- bg_color[3] = 8.0f;
+ UI_GetThemeColorShade4fv(TH_CFRAME, -5, bg_color);
UI_draw_roundbox_corner_set(UI_CNR_ALL);
- UI_draw_roundbox_aa(true,
- frame_x - box_width / 2,
+
+ UI_draw_roundbox_3fvAlpha(true,
+ frame_x - box_width / 2 + U.pixelsize / 2,
+ scrubbing_region_rect->ymin + box_padding,
+ frame_x + box_width / 2 + U.pixelsize / 2,
+ scrubbing_region_rect->ymax - box_padding,
+ 4 * UI_DPI_FAC,
+ bg_color,
+ 1.0f);
+
+ UI_GetThemeColorShade4fv(TH_CFRAME, 5, bg_color);
+ UI_draw_roundbox_aa(false,
+ frame_x - box_width / 2 + U.pixelsize / 2,
scrubbing_region_rect->ymin + box_padding,
- frame_x + box_width / 2,
+ frame_x + box_width / 2 + U.pixelsize / 2,
scrubbing_region_rect->ymax - box_padding,
- 5 * UI_DPI_FAC,
+ 4 * UI_DPI_FAC,
bg_color);
UI_fontstyle_draw_simple(fstyle,
- frame_x - text_width / 2,
+ frame_x - text_width / 2 + U.pixelsize / 2,
get_centered_text_y(scrubbing_region_rect),
frame_str,
color);
More information about the Bf-blender-cvs
mailing list