diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-03-09 10:00:40 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-03-09 10:00:40 +0300 |
commit | 6475e462fa1d3da30baac9a91b45779078169716 (patch) | |
tree | 537c58dad242141a7d3ee57225363443aad6b3c6 /source/blender | |
parent | f73d7c697cc092fa4e3239f2a3f62ed190509287 (diff) |
Graph Editor: Frame numbers in horizontal scrollbar are no longer restricted to 1.0 frame intervals.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/include/UI_view2d.h | 1 | ||||
-rw-r--r-- | source/blender/editors/interface/view2d.c | 8 | ||||
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 2 |
3 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/editors/include/UI_view2d.h b/source/blender/editors/include/UI_view2d.h index cdb69477f12..eacdba9218e 100644 --- a/source/blender/editors/include/UI_view2d.h +++ b/source/blender/editors/include/UI_view2d.h @@ -68,6 +68,7 @@ enum { /* for drawing time */ V2D_UNIT_SECONDS = 0, V2D_UNIT_FRAMES, + V2D_UNIT_FRAMESCALE, /* for drawing values */ V2D_UNIT_VALUES, diff --git a/source/blender/editors/interface/view2d.c b/source/blender/editors/interface/view2d.c index 693f540128f..6e738942e29 100644 --- a/source/blender/editors/interface/view2d.c +++ b/source/blender/editors/interface/view2d.c @@ -1468,10 +1468,14 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v /* draw numbers in the appropriate range */ if (dfac > 0.0f) { for (; fac < hor.xmax; fac+=dfac, val+=grid->dx) { - switch (vs->xunits) { + switch (vs->xunits) { case V2D_UNIT_FRAMES: /* frames (as whole numbers)*/ scroll_printstr(vs, scene, fac, 3.0f+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_FRAMES, 'h'); break; + + case V2D_UNIT_FRAMESCALE: /* frames (not always as whole numbers) */ + scroll_printstr(vs, scene, fac, 3.0f+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_FRAMESCALE, 'h'); + break; case V2D_UNIT_SECONDS: /* seconds */ fac2= val/(float)FPS; @@ -1490,7 +1494,7 @@ void UI_view2d_scrollers_draw(const bContext *C, View2D *v2d, View2DScrollers *v } break; - case V2D_UNIT_DEGREES: /* IPO-Editor for rotation IPO-Drivers */ + case V2D_UNIT_DEGREES: /* Graph Editor for rotation Drivers */ /* HACK: although we're drawing horizontal, we make this draw as 'vertical', just to get degree signs */ scroll_printstr(vs, scene, fac, 3.0f+(float)(hor.ymin), val, grid->powerx, V2D_UNIT_DEGREES, 'v'); break; diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index a43f8ee3502..e6365db92ad 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -227,7 +227,7 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar) UI_view2d_view_ortho(C, v2d); /* grid */ - unitx= (sipo->flag & SIPO_DRAWTIME)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMES; + unitx= (sipo->flag & SIPO_DRAWTIME)? V2D_UNIT_SECONDS : V2D_UNIT_FRAMESCALE; grid= UI_view2d_grid_calc(C, v2d, unitx, V2D_GRID_NOCLAMP, unity, V2D_GRID_NOCLAMP, ar->winx, ar->winy); UI_view2d_grid_draw(C, v2d, grid, V2D_GRIDLINES_ALL); UI_view2d_grid_free(grid); |