diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-10-20 16:04:56 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-10-20 16:04:56 +0400 |
commit | 00f3d83b6ab5f4f9ee4f69457e492db72a03cf30 (patch) | |
tree | dd57f5d8b0bb859a0403225a11d118844a728c68 /source/blender/editors/space_graph/space_graph.c | |
parent | ec6bccfad1609fa09a703d7496310da246fd5825 (diff) |
Graph Editor: Added 2D Cursor
I've finally given in, and implemented a '2d-cursor' for the Graph Editor. This is simply represented as an additional horizontal line that meets with the current frame indicator, forming a cross-hair. It can be disabled from the View menu.
Currently, the only tool which takes this into account is the Snapping tools (Shift-S), where I've hooked up a tool I added some time ago.
TODO:
- expose this cursor to the transform tools for scaling/rotation options...
Diffstat (limited to 'source/blender/editors/space_graph/space_graph.c')
-rw-r--r-- | source/blender/editors/space_graph/space_graph.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 1f65a8cd7ea..b4b06844d13 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -261,6 +261,27 @@ static void graph_main_area_draw(const bContext *C, ARegion *ar) /* only free grid after drawing data, as we need to use it to determine sampling rate */ UI_view2d_grid_free(grid); + /* horizontal component of value-cursor (value line before the current frame line) */ + if ((sipo->flag & SIPO_NODRAWCURSOR)==0) { + float vec[2]; + + /* Draw a green line to indicate the cursor value */ + vec[1]= sipo->cursorVal; + + UI_ThemeColorShadeAlpha(TH_CFRAME, -10, -50); + glLineWidth(2.0); + + glEnable(GL_BLEND); + glBegin(GL_LINE_STRIP); + vec[0]= v2d->cur.xmin; + glVertex2fv(vec); + + vec[0]= v2d->cur.xmax; + glVertex2fv(vec); + glEnd(); // GL_LINE_STRIP + glDisable(GL_BLEND); + } + /* current frame */ if (sipo->flag & SIPO_DRAWTIME) flag |= DRAWCFRA_UNIT_SECONDS; if ((sipo->flag & SIPO_NODRAWCFRANUM)==0) flag |= DRAWCFRA_SHOW_NUMBOX; |