NLA SoC: Attempt at solving the jumping-views problem
authorJoshua Leung <aligorith@gmail.com>
Fri, 10 Jul 2009 12:42:17 +0000 (12:42 +0000)
committerJoshua Leung <aligorith@gmail.com>
Fri, 10 Jul 2009 12:42:17 +0000 (12:42 +0000)
The 'jumping-views' problem affected the NLA and DopeSheet editors, whereby the channels-list and the data-area would get out of sync (vertically) due to the size calculations of the two being done differently.

source/blender/editors/space_action/action_draw.c
source/blender/editors/space_nla/nla_draw.c

index 93d061e8bf36ff6ff4d7dc2598cd77f7d2f06c3a..2fd5b9bbd93983037c49bb7a199a86255e59a6d5 100644 (file)
@@ -422,6 +422,8 @@ void draw_channel_names(bAnimContext *ac, SpaceAction *saction, ARegion *ar)
                 */
                v2d->tot.ymin= (float)(-height);
        }
+       /* need to do a view-sync here, so that the keys area doesn't jump around */
+       UI_view2d_sync(NULL, ac->sa, v2d, V2D_VIEWSYNC_AREA_VERTICAL);
        
        /* loop through channels, and set up drawing depending on their type  */        
        y= (float)ACHANNEL_FIRST;
index 6219acf6faef6700e36b31f5a380b62badc32732..7fb15c62277ea59b100ea9c4ad7ac0c8fd1e79b7 100644 (file)
@@ -512,6 +512,8 @@ void draw_nla_main_data (bAnimContext *ac, SpaceNla *snla, ARegion *ar)
         * (NOTE: this is ok here, the configuration is pretty straightforward) 
         */
        v2d->tot.ymin= (float)(-height);
+       /* need to do a view-sync here, so that the strips area doesn't jump around */
+       UI_view2d_sync(NULL, ac->sa, v2d, V2D_VIEWSYNC_AREA_VERTICAL);
        
        /* loop through channels, and set up drawing depending on their type  */        
        y= (float)(-NLACHANNEL_HEIGHT);