2.5 - Assorted tweaks for anim editors before porting AnimSys2 stuff over to this...
authorJoshua Leung <aligorith@gmail.com>
Thu, 18 Dec 2008 23:23:09 +0000 (23:23 +0000)
committerJoshua Leung <aligorith@gmail.com>
Thu, 18 Dec 2008 23:23:09 +0000 (23:23 +0000)
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_ipo/space_ipo.c

index 559d6b212494a65da01a63bd5e1fc27d226738aa..7e30be90b5ed2ced0aa0c858a7f85a72822f0946 100644 (file)
@@ -5086,14 +5086,14 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                                BLI_addtail(lb, ar);
                                ar->regiontype= RGN_TYPE_CHANNELS;
                                ar->alignment= RGN_ALIGN_LEFT;
-                               ar->v2d.scroll= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
+                               ar->v2d.scroll= V2D_SCROLL_BOTTOM;
                                break;
                        case SPACE_NLA:
                                ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
                                BLI_addtail(lb, ar);
                                ar->regiontype= RGN_TYPE_CHANNELS;
                                ar->alignment= RGN_ALIGN_LEFT;
-                               ar->v2d.scroll= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
+                               ar->v2d.scroll= V2D_SCROLL_BOTTOM;
                                break;
                }
        }
@@ -5163,6 +5163,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                                
                                ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
                                ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
+                               ar->v2d.align = V2D_ALIGN_NO_POS_Y;
                                //ar->v2d.flag |= V2D_IS_INITIALISED;
                                break;
                        }
@@ -5173,6 +5174,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                                
                                ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
                                ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
+                               ar->v2d.align = V2D_ALIGN_NO_POS_Y;
                                //ar->v2d.flag |= V2D_IS_INITIALISED;
                                break;
                        }
index 4b29167e844856621c13b13ae9aa36bed2870903..0ebcd88ffb2c589ee39f5c255dec15b14343ca31 100644 (file)
@@ -87,7 +87,7 @@ static SpaceLink *action_new(void)
        ar->alignment= RGN_ALIGN_LEFT;
        
                /* only need to set scroll settings, as this will use 'listview' v2d configuration */
-       ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
+       ar->v2d.scroll = V2D_SCROLL_BOTTOM;
        ar->v2d.flag = V2D_VIEWSYNC_Y;
        
        /* main area */
@@ -104,7 +104,7 @@ static SpaceLink *action_new(void)
        ar->v2d.cur.xmin= -2.0f;
        ar->v2d.cur.ymin= -200.0f;
        ar->v2d.cur.xmax= 100.0f;
-       ar->v2d.cur.ymax= 0.0f;
+       ar->v2d.cur.ymax= -20.0f;
        
        ar->v2d.min[0]= 0.0f;
        ar->v2d.min[1]= 0.0f;
index 1c1c5997ee7fe58c9787e73d6bee90edbbd8434a..dbf75e34dc33d41c4357db06a38dd7fbb96dac02 100644 (file)
@@ -85,6 +85,8 @@ static SpaceLink *ipo_new(void)
        ar->regiontype= RGN_TYPE_CHANNELS;
        ar->alignment= RGN_ALIGN_LEFT;
        
+       ar->v2d.scroll = (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM);
+       
        /* XXX view2d init for channels */
        
        /* main area */
@@ -251,8 +253,16 @@ void ipo_keymap(struct wmWindowManager *wm)
 {
 }
 
+static void ipo_channel_area_init(wmWindowManager *wm, ARegion *ar)
+{
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
+}
+
 static void ipo_channel_area_draw(const bContext *C, ARegion *ar)
 {
+       //SpaceIpo *sipo= C->area->spacedata.first;
+       View2D *v2d= &ar->v2d;
+       View2DScrollers *scrollers;
        float col[3];
        
        /* clear and setup matrix */
@@ -260,6 +270,17 @@ static void ipo_channel_area_draw(const bContext *C, ARegion *ar)
        glClearColor(col[0], col[1], col[2], 0.0);
        glClear(GL_COLOR_BUFFER_BIT);
        
+       UI_view2d_view_ortho(C, v2d);
+       
+       /* data... */
+       
+       /* reset view matrix */
+       UI_view2d_view_restore(C);
+       
+       /* scrollers */
+       scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
+       UI_view2d_scrollers_draw(C, v2d, scrollers);
+       UI_view2d_scrollers_free(scrollers);
 }
 
 /* add handlers, stuff you only do once or on area/region changes */
@@ -343,7 +364,7 @@ void ED_spacetype_ipo(void)
        art->minsizex= 200;
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
        
-//     art->init= ipo_channel_area_init;
+       art->init= ipo_channel_area_init;
        art->draw= ipo_channel_area_draw;
        
        BLI_addhead(&st->regiontypes, art);