CKEY in the action window scrolls the window so that the current frame
authorChris Want <cwant@ualberta.ca>
Tue, 28 Jan 2003 19:54:19 +0000 (19:54 +0000)
committerChris Want <cwant@ualberta.ca>
Tue, 28 Jan 2003 19:54:19 +0000 (19:54 +0000)
is in the center.

source/blender/include/BSE_drawipo.h
source/blender/src/drawipo.c
source/blender/src/editaction.c

index 65545441ff80b8e80ec34581c693a6310cfe1140..17c53fc6e2d89b0cbe16fabb74da06d8aa875b16 100644 (file)
@@ -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); 
index d72799acbf02817c4a205026fe92557f092a3098..4b7dbcab05f920b858eb9c6db455dcd65617a20f 100644 (file)
@@ -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 */
index e521d59e6751f1ed5da5ffede3b40e00523248e3..1289b44a0b0f460452f61b7943c8000a344b33b5 100644 (file)
@@ -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();