forked from bartvdbraak/blender
CKEY in the action window scrolls the window so that the current frame
is in the center.
This commit is contained in:
parent
1bbd7b1392
commit
57b03cba73
@ -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);
|
||||
|
@ -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 */
|
||||
|
@ -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();
|
||||
|
Loading…
Reference in New Issue
Block a user