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:
authorJoshua Leung <aligorith@gmail.com>2018-04-24 20:18:22 +0300
committerJoshua Leung <aligorith@gmail.com>2018-04-24 20:18:31 +0300
commitb05fd95f8aaf3eecb88dbb87744fec7bda30fa1f (patch)
treeba86fc0063cd639954a85ea4724946a2fd2cafcf /source/blender/editors/space_graph/space_graph.c
parent9511cc13d75a156743bf55a73d5c7fc8f56fe72b (diff)
Current Frame Indicator tweaks
* Draw the frame/time number box over the scrollbar instead of above it, to reduce the clutter/clashes with markers. * Draw the box centered around the line instead of off to one side, making it clearer that the frame shown is the one being affected. * Make the box larger than the scrollbar + use white text to make it stand out from the neighbouring frame numbers (otherwise, it's easy to misread that it's just another one of those)
Diffstat (limited to 'source/blender/editors/space_graph/space_graph.c')
-rw-r--r--source/blender/editors/space_graph/space_graph.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c
index 381cb1d9e6e..f59d70d97c7 100644
--- a/source/blender/editors/space_graph/space_graph.c
+++ b/source/blender/editors/space_graph/space_graph.c
@@ -234,7 +234,7 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar)
View2DGrid *grid;
View2DScrollers *scrollers;
float col[3];
- short unitx = 0, unity = V2D_UNIT_VALUES, flag = 0;
+ short unitx = 0, unity = V2D_UNIT_VALUES, cfra_flag = 0;
/* clear and setup matrix */
UI_GetThemeColor3fv(TH_BACK, col);
@@ -281,7 +281,6 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar)
/* horizontal component of value-cursor (value line before the current frame line) */
if ((sipo->flag & SIPO_NODRAWCURSOR) == 0) {
-
float y = sipo->cursorVal;
/* Draw a green line to indicate the cursor value */
@@ -320,9 +319,8 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar)
if (sipo->mode != SIPO_MODE_DRIVERS) {
/* current frame */
- if (sipo->flag & SIPO_DRAWTIME) flag |= DRAWCFRA_UNIT_SECONDS;
- if ((sipo->flag & SIPO_NODRAWCFRANUM) == 0) flag |= DRAWCFRA_SHOW_NUMBOX;
- ANIM_draw_cfra(C, v2d, flag);
+ if (sipo->flag & SIPO_DRAWTIME) cfra_flag |= DRAWCFRA_UNIT_SECONDS;
+ ANIM_draw_cfra(C, v2d, cfra_flag);
}
/* markers */
@@ -345,6 +343,12 @@ static void graph_main_region_draw(const bContext *C, ARegion *ar)
scrollers = UI_view2d_scrollers_calc(C, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP);
UI_view2d_scrollers_draw(C, v2d, scrollers);
UI_view2d_scrollers_free(scrollers);
+
+ /* draw current frame number-indicator on top of scrollers */
+ if ((sipo->mode != SIPO_MODE_DRIVERS) && ((sipo->flag & SIPO_NODRAWCFRANUM) == 0)) {
+ UI_view2d_view_orthoSpecial(ar, v2d, 1);
+ ANIM_draw_cfra_number(C, v2d, cfra_flag);
+ }
}
static void graph_channel_region_init(wmWindowManager *wm, ARegion *ar)