diff options
author | Hans Goudey <h.goudey@me.com> | 2020-06-02 05:12:09 +0300 |
---|---|---|
committer | Hans Goudey <h.goudey@me.com> | 2020-06-02 05:12:09 +0300 |
commit | 4f3e686cad9b7774fd70c03d77d8eeb7d8249986 (patch) | |
tree | 5cde209d93e95192288f2a7ae050e4cfefb55b67 /source | |
parent | 8b63c6241db928de3729e560d8c723a4849924b4 (diff) |
Cleanup: Remove Obsolete Current Frame Indicator Drawing Code
This code was made obsolete by the changes to the animation editor
scrubbing areas in D4654.
Differential Revision: https://developer.blender.org/D7898
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/animation/anim_draw.c | 61 | ||||
-rw-r--r-- | source/blender/editors/include/ED_anim_api.h | 3 |
2 files changed, 0 insertions, 64 deletions
diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 4203c2677b7..a2a1f7eb1d2 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -62,67 +62,6 @@ /* *************************************************** */ /* CURRENT FRAME DRAWING */ -/* Draw current frame number in a little green box beside the current frame indicator */ -void ANIM_draw_cfra_number(const bContext *C, View2D *v2d, short flag) -{ - Scene *scene = CTX_data_scene(C); - const float time = scene->r.cfra + scene->r.subframe; - const float cfra = (float)(time * scene->r.framelen); - const bool show_time = (flag & DRAWCFRA_UNIT_SECONDS) != 0; - - const uiFontStyle *fstyle = UI_FSTYLE_WIDGET; - uchar col[4]; - float color[4]; - float xscale, x, y; - char numstr[32] = " t "; /* t is the character to start replacing from */ - float hlen; - int slen; - - /* because the frame number text is subject to the same scaling as the contents of the view */ - UI_view2d_scale_get(v2d, &xscale, NULL); - GPU_matrix_push(); - GPU_matrix_scale_2f(1.0f / xscale, 1.0f); - - /* get timecode string - * - padding on str-buf passed so that it doesn't sit on the frame indicator - */ - if (show_time) { - BLI_timecode_string_from_time( - &numstr[2], sizeof(numstr) - 2, 0, FRA2TIME(cfra), FPS, U.timecode_style); - } - else { - BLI_timecode_string_from_time_seconds(&numstr[2], sizeof(numstr) - 2, 1, cfra); - } - - slen = UI_fontstyle_string_width(fstyle, numstr) - 1; - hlen = slen * 0.5f; - - /* get starting coordinates for drawing */ - x = cfra * xscale; - y = -0.1f * U.widget_unit; - - /* draw green box around/behind text */ - UI_GetThemeColor4fv(TH_CFRAME, color); - color[3] = 3.0f; - - UI_draw_roundbox_corner_set(UI_CNR_ALL); - UI_draw_roundbox_aa(true, - x - hlen - 0.1f * U.widget_unit, - y + 3.0f, - x + hlen + 0.1f * U.widget_unit, - y - 3.0f + U.widget_unit, - 0.1f * U.widget_unit, - color); - - /* draw current frame number */ - UI_GetThemeColor4ubv(TH_TEXT_HI, col); - UI_fontstyle_draw_simple( - fstyle, x - hlen - 0.15f * U.widget_unit, y + 0.28f * U.widget_unit, numstr, col); - - /* restore view transform */ - GPU_matrix_pop(); -} - /* General call for drawing current frame indicator in animation editor */ void ANIM_draw_cfra(const bContext *C, View2D *v2d, short flag) { diff --git a/source/blender/editors/include/ED_anim_api.h b/source/blender/editors/include/ED_anim_api.h index 7d38792f332..426a470b128 100644 --- a/source/blender/editors/include/ED_anim_api.h +++ b/source/blender/editors/include/ED_anim_api.h @@ -652,9 +652,6 @@ enum eAnimEditDraw_CurrentFrame { /* main call to draw current-frame indicator in an Animation Editor */ void ANIM_draw_cfra(const struct bContext *C, struct View2D *v2d, short flag); -/* main call to draw "number box" in scrollbar for current frame indicator */ -void ANIM_draw_cfra_number(const struct bContext *C, struct View2D *v2d, short flag); - /* ------------- Preview Range Drawing -------------- */ /* main call to draw preview range curtains */ |