diff options
author | Chris Want <cwant@ualberta.ca> | 2003-01-28 22:54:19 +0300 |
---|---|---|
committer | Chris Want <cwant@ualberta.ca> | 2003-01-28 22:54:19 +0300 |
commit | 57b03cba73aef704c067dfd5931cc88c9979cd58 (patch) | |
tree | 105b98535a69b5e3ff61121b3bc983b122d5f337 /source | |
parent | 1bbd7b13922f979449811160f3f673f9866e61bc (diff) |
CKEY in the action window scrolls the window so that the current frame
is in the center.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/include/BSE_drawipo.h | 1 | ||||
-rw-r--r-- | source/blender/src/drawipo.c | 20 | ||||
-rw-r--r-- | source/blender/src/editaction.c | 8 |
3 files changed, 29 insertions, 0 deletions
diff --git a/source/blender/include/BSE_drawipo.h b/source/blender/include/BSE_drawipo.h index 65545441ff8..17c53fc6e2d 100644 --- a/source/blender/include/BSE_drawipo.h +++ b/source/blender/include/BSE_drawipo.h @@ -59,6 +59,7 @@ int in_ipo_buttons(void); void drawscroll(int disptype); void drawipo(void); +void center_currframe(void); void scroll_ipobuts(void); int view2dzoom(unsigned short event); int view2dmove(unsigned short event); diff --git a/source/blender/src/drawipo.c b/source/blender/src/drawipo.c index d72799acbf0..4b7dbcab05f 100644 --- a/source/blender/src/drawipo.c +++ b/source/blender/src/drawipo.c @@ -1532,6 +1532,26 @@ int view2dzoom(unsigned short event) return 1; } +void center_currframe(void) +{ + /* place the current frame in the + * center of the 2D window. + */ + float width; + + areawinset(curarea->win); + curarea->head_swap= 0; + + width = G.v2d->cur.xmax - G.v2d->cur.xmin; + G.v2d->cur.xmin = CFRA - 0.5*(width); + G.v2d->cur.xmax = CFRA + 0.5*(width); + + test_view2d(G.v2d, curarea->winx, curarea->winy); + scrarea_do_windraw(curarea); + screen_swapbuffers(); + curarea->head_swap= 0; +} + int view2dmove(unsigned short event) { /* return 1 als er iets gedaan is */ diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c index e521d59e675..1289b44a0b0 100644 --- a/source/blender/src/editaction.c +++ b/source/blender/src/editaction.c @@ -1405,6 +1405,14 @@ void winqreadactionspace(unsigned short event, short val, char ascii) case HOMEKEY: do_action_buttons(B_ACTHOME); break; + + case CKEY: + /* scroll the window so the current + * frame is in the center. + */ + center_currframe(); + break; + case DKEY: if (G.qual & LR_SHIFTKEY && mval[0]>ACTWIDTH){ duplicate_actionchannel_keys(); |