View2D: Presets for Initialising Views
authorJoshua Leung <aligorith@gmail.com>
Tue, 16 Dec 2008 11:24:24 +0000 (11:24 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 16 Dec 2008 11:24:24 +0000 (11:24 +0000)
Improved the View2D API so that initialising View2D data in init() callbacks (called on new regions and also on resizing regions) for regions is easier.

Added a few preset view configurations for use when initialising new views. Views with the V2D_IS_INITIALISED flag set will not be reinitialised in the init() callbacks. Currently, some of these configurations will set/override all settings (like V2D_COMMONVIEW_LIST and V2D_COMMONVIEW_HEADER), while other ones serve a more supplimentary role (i.e. V2D_COMMONVIEW_TIMELINE only sets the x-axis settings, relying on the region to have already set the relevant y-axis settings).
The future of such supplimentary configurations is yet to be seen, as I'm currently not sure whether they will cause the code to become too confusing, as you'd have to keep track of which settings belong/are set where. So far, only a few areas have been ported to use this. Tomorrow I'll check on a few more.

As this commit touches a lot of files, hopefully there aren't any critical bugs I've missed here.

20 files changed:
source/blender/blenloader/intern/readfile.c
source/blender/editors/include/UI_view2d.h
source/blender/editors/interface/view2d.c
source/blender/editors/interface/view2d_ops.c
source/blender/editors/space_action/space_action.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_image/space_image.c
source/blender/editors/space_info/space_info.c
source/blender/editors/space_ipo/space_ipo.c
source/blender/editors/space_nla/space_nla.c
source/blender/editors/space_node/space_node.c
source/blender/editors/space_outliner/space_outliner.c
source/blender/editors/space_script/space_script.c
source/blender/editors/space_sequencer/space_sequencer.c
source/blender/editors/space_sound/space_sound.c
source/blender/editors/space_text/space_text.c
source/blender/editors/space_time/space_time.c
source/blender/editors/space_view3d/space_view3d.c
source/blender/makesdna/DNA_view2d_types.h

index adc7c657019c22a9cd19d116f6315848bc714a11..5452429e8ea9d679a50df550bd16f79d04724535 100644 (file)
@@ -5061,7 +5061,7 @@ static void area_add_header_region(ScrArea *sa, ListBase *lb)
        /* is copy from ui_view2d.c */
        ar->v2d.keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
        ar->v2d.keepofs = V2D_LOCKOFS_Y;
-       ar->v2d.keeptot = 2; // this keeps the view in place when region size changes...
+       ar->v2d.keeptot = V2D_KEEPTOT_STRICT; 
        ar->v2d.align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y;
        
 }
@@ -5116,7 +5116,8 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                                ar->v2d.scroll |= (V2D_SCROLL_RIGHT|V2D_SCROLL_BOTTOM_O);
                                ar->v2d.align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
                                ar->v2d.keepzoom |= (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPASPECT);
-                               ar->v2d.keeptot = 2;
+                               ar->v2d.keeptot = V2D_KEEPTOT_STRICT;
+                               ar->v2d.flag |= V2D_IS_INITIALISED;
                        }
                                break;
                        case SPACE_TIME:
@@ -5130,6 +5131,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                                ar->v2d.keepzoom |= V2D_LOCKZOOM_Y;
                                ar->v2d.tot.ymin= ar->v2d.cur.ymin= -10.0;
                                ar->v2d.min[1]= ar->v2d.max[1]= 20.0;
+                               ar->v2d.flag |= V2D_IS_INITIALISED;
                        }
                                break;
                        case SPACE_IPO:
@@ -5139,6 +5141,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_LEFT|V2D_SCROLL_SCALE_VERTICAL);
+                               ar->v2d.flag |= V2D_IS_INITIALISED;
                                break;
                        }
                        case SPACE_SOUND:
@@ -5148,6 +5151,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_LEFT);
+                               ar->v2d.flag |= V2D_IS_INITIALISED;
                                break;
                        }
                        case SPACE_NLA:
@@ -5157,6 +5161,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.flag |= V2D_IS_INITIALISED;
                                break;
                        }
                        case SPACE_ACTION:
@@ -5166,6 +5171,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.flag |= V2D_IS_INITIALISED;
                                break;
                        }
                        case SPACE_SEQ:
@@ -5175,12 +5181,14 @@ 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_LEFT|V2D_SCROLL_SCALE_VERTICAL);
+                               ar->v2d.flag |= V2D_IS_INITIALISED;
                                break;
                        }
                        case SPACE_NODE:
                        {
                                SpaceNode *snode= (SpaceNode *)sl;
                                memcpy(&ar->v2d, &snode->v2d, sizeof(View2D));
+                               ar->v2d.flag |= V2D_IS_INITIALISED;
                                break;
                        }
                        case SPACE_BUTS:
@@ -5188,6 +5196,7 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                                SpaceButs *sbuts= (SpaceButs *)sl;
                                memcpy(&ar->v2d, &sbuts->v2d, sizeof(View2D));
                                ar->v2d.keepzoom |= V2D_KEEPASPECT;
+                               ar->v2d.flag |= V2D_IS_INITIALISED;
                                break;
                        }
                                //case SPACE_XXX: // FIXME... add other ones
index 8d8b137732acd14261fc977ce51fc86ed97be5f6..09d57901b0b0b903c6aea5528135501e1afe9b62 100644 (file)
 enum {
                /* custom view type (region has defined all necessary flags already) */
        V2D_COMMONVIEW_CUSTOM = 0,
+               /* view canvas ('standard' view, view limits/restrictions still need to be set first!) */
+       V2D_COMMONVIEW_VIEWCANVAS,
                /* listview (i.e. Outliner) */
        V2D_COMMONVIEW_LIST,
                /* headers (this is basically the same as listview, but no y-panning) */
        V2D_COMMONVIEW_HEADER,
+               /* timegrid (this sets the settings for x/horizontal, but y/vertical settings still need to be set first!) */
+       V2D_COMMONVIEW_TIMELINE,
 } eView2D_CommonViewTypes;
 
 /* ---- Defines for Scroller/Grid Arguments ----- */
@@ -125,10 +129,7 @@ typedef struct View2DScrollers View2DScrollers;
 /* Prototypes:                                             */
 
 /* refresh and validation (of view rects) */
-void UI_view2d_regiondata_init(struct View2D *v2d, short type, int winx, int winy);
-void UI_view2d_header_default(struct View2D *v2d);
-
-void UI_view2d_size_update(struct View2D *v2d, int winx, int winy);
+void UI_view2d_region_reinit(struct View2D *v2d, short type, int winx, int winy);
 
 void UI_view2d_curRect_validate(struct View2D *v2d);
 void UI_view2d_curRect_reset(struct View2D *v2d);
index fb5fbf940e8a41e3542bae1513869a7ff9554f4b..a5ec52b3d3846035be34534d4e983dd4e77a8372 100644 (file)
 /* *********************************************************************** */
 /* Refresh and Validation */
 
-/* Initialise all View2D data for a given region */
+/* Initialise all relevant View2D data (including view rects if first time) and/or refresh mask sizes after view resize
+ *     - for some of these presets, it is expected that the region will have defined some
+ *       additional settings necessary for the customisation of the 2D viewport to its requirements
+ *     - this function should only be called from region init() callbacks, where it is expected that
+ *       this is called before UI_view2d_size_update(), as this one checks that the rects are properly initialised. 
+ */
 // eView2D_CommonViewTypes <--- only check handle these types...
-void UI_view2d_regiondata_init(View2D *v2d, short type, int winx, int winy)
-{
-       
-}
-
-
-/* allowing horizontal pan */
-// XXX this should become one of 'standard' setups...
-void UI_view2d_header_default(View2D *v2d)
+void UI_view2d_region_reinit(View2D *v2d, short type, int winx, int winy)
 {
-       v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
-       v2d->keepofs = V2D_LOCKOFS_Y;
-       v2d->keeptot = 2; // this keeps the view in place when region size changes...
-       v2d->align = V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y;
+       short tot_changed= 0;
        
-}
-
-/* Adjust mask size in response to view size changes 
- *     - This should only be called in region init() callbacks, which are
- *       called when the region is resized or area changes...
- */
-// XXX pre2.5 -> this used to be called  calc_scrollrcts()
-void UI_view2d_size_update(View2D *v2d, int winx, int winy)
-{
+       /* store view size */
        v2d->winx= winx;
        v2d->winy= winy;
        
@@ -138,22 +124,96 @@ void UI_view2d_size_update(View2D *v2d, int winx, int winy)
                }
        }
        
-       /* cope with unitialized veriables for simple cases, like header or outliner */
-       // XXX er... this shouldn't be here??? or at least some extra checks are needed for some things...
-       if ((v2d->tot.xmin==v2d->tot.xmax) || (v2d->cur.xmin==v2d->cur.xmax)) {
-               if (v2d->keepzoom & (V2D_KEEPZOOM|V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y)) {
-                       BLI_init_rctf(&v2d->tot, v2d->mask.xmin, v2d->mask.xmax, v2d->mask.ymin, v2d->mask.ymax);
-                       BLI_init_rctf(&v2d->cur, v2d->mask.xmin, v2d->mask.xmax, v2d->mask.ymin, v2d->mask.ymax);
+       /* initialise data if there is a need for such */
+       if ((v2d->flag & V2D_IS_INITIALISED) == 0) {
+               v2d->flag |= V2D_IS_INITIALISED;
+               
+               /* see eView2D_CommonViewTypes in UI_view2d.h for available view presets */
+               switch (type) {
+                       /* 'standard view' - from (0,0) to (winx,winy), with other restrictions defined by region already */
+                       case V2D_COMMONVIEW_VIEWCANVAS: 
+                       {
+                               /* just set 'tot' rect alignment restictions for now */
+                               v2d->align= V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y;
+                               tot_changed= 1;
+                               
+                               // XXX... should we set min/max here too? probably not essential yet
+                       }
+                               break;
                        
-                       v2d->min[0]= v2d->max[0]= winx;
-                       v2d->min[1]= v2d->max[1]= winy;
-                       v2d->minzoom= 1.0f;
-                       v2d->maxzoom= 1.0f;
+                       /* 'list/channel view' - zoom, aspect ratio, and alignment restrictions are set here */
+                       case V2D_COMMONVIEW_LIST:
+                       {
+                               /* zoom + aspect ratio are locked */
+                               v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
+                               v2d->minzoom= v2d->maxzoom= 1.0f;
+                               
+                               /* tot rect has strictly regulated placement, and must only occur in +/- quadrant */
+                               v2d->align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_POS_Y);
+                               v2d->keeptot = V2D_KEEPTOT_STRICT;
+                               tot_changed= 1;
+                               
+                               /* scroller settings are currently not set here... that is left for regions... */
+                       }
+                               break;
+                               
+                       /* 'header' regions - zoom, aspect ratio, alignment, and panning restrictions are set here */
+                       case V2D_COMMONVIEW_HEADER:
+                       {
+                               /* zoom + aspect ratio are locked */
+                               v2d->keepzoom = (V2D_LOCKZOOM_X|V2D_LOCKZOOM_Y|V2D_KEEPZOOM|V2D_KEEPASPECT);
+                               v2d->minzoom= v2d->maxzoom= 1.0f;
+                               v2d->min[0]= v2d->max[0]= winx;
+                               v2d->min[1]= v2d->max[1]= winy;
+                               
+                               /* tot rect has strictly regulated placement, and must only occur in +/+ quadrant */
+                               v2d->align = (V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y);
+                               v2d->keeptot = V2D_KEEPTOT_STRICT;
+                               tot_changed= 1;
+                               
+                               /* panning in y-axis is prohibited */
+                               v2d->keepofs= V2D_LOCKOFS_Y;
+                               
+                               /* absolutely no scrollers allowed */
+                               v2d->scroll= 0;
+                       }
+                               break;
+                               
+                       /* 'timeline/animeditors' - only set x-axis settings (y axis settings have already been set by regions, so don't overwrite! */
+                       case V2D_COMMONVIEW_TIMELINE:
+                       {
+                               /* zoom on x-axis is free, but zoom factors are usually standard */
+                               v2d->minzoom= 0.5f;
+                               v2d->maxzoom= 10.0f;
+                               
+                               /* size limits on x-axis are also standard */
+                               v2d->min[0]= 0.0f; // XXX... would 1.0f be better?
+                               v2d->max[0]= MAXFRAMEF;
+                               
+                               /* scrollers for x-axis must be shown, and with scales */
+                               v2d->scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
+                               
+                               /* 'tot' rect x-axis size */
+                               v2d->tot.xmin= (float)(SFRA - 10);
+                               v2d->tot.xmax= (float)(EFRA + 10);
+                               v2d->cur.xmin= v2d->mask.xmin;
+                               v2d->cur.xmax= v2d->mask.xmax;
+                               tot_changed= 0; // er..
+                       }
+                               break;
+                               
+                       /* other view types are completely defined using their own settings already */
+                       default:
+                               /* we don't do anything here, as settings should be fine, but just make sure that rect */
+                               break;  
                }
        }
        
-       /* make sure that 'cur' rect is in a valid state as a result of these changes */
-       UI_view2d_curRect_validate(v2d);
+       /* set 'tot' rect before setting cur? */
+       if (tot_changed) 
+               UI_view2d_totRect_set(v2d, winx, winy);
+       else
+               UI_view2d_curRect_validate(v2d);
 }
 
 /* Ensure View2D rects remain in a viable configuration 
@@ -254,7 +314,7 @@ void UI_view2d_curRect_validate(View2D *v2d)
                do_win= do_y;
                
                if (do_cur) {
-                       if ((v2d->keeptot == 2) && (winx != v2d->oldwinx)) {
+                       if ((v2d->keeptot == V2D_KEEPTOT_STRICT) && (winx != v2d->oldwinx)) {
                                /* special exception for Outliner (and later channel-lists):
                                 *      - The view may be moved left to avoid contents being pushed out of view when view shrinks. 
                                 *      - The keeptot code will make sure cur->xmin will not be less than tot->xmin (which cannot be allowed)
@@ -321,8 +381,8 @@ void UI_view2d_curRect_validate(View2D *v2d)
                        if (cur->xmin < tot->xmin) cur->xmin= tot->xmin;
                        if (cur->xmax > tot->xmax) cur->xmax= tot->xmax;
                }
-               else if (v2d->keeptot == 2) {
-                       /* This is an exception for the outliner (and later channel-lists) 
+               else if (v2d->keeptot == V2D_KEEPTOT_STRICT) {
+                       /* This is an exception for the outliner (and later channel-lists, headers
                         *      - must clamp within tot rect (absolutely no excuses)
                         *      --> therefore, cur->xmin must not be less than tot->xmin
                         */
@@ -441,7 +501,9 @@ void UI_view2d_curRect_validate(View2D *v2d)
 
 /* ------------------ */
 
-/* Restore 'cur' rect to standard orientation (i.e. optimal maximum view of tot) */
+/* Restore 'cur' rect to standard orientation (i.e. optimal maximum view of tot) 
+ * This does not take into account if zooming the view on an axis will improve the view (if allowed)
+ */
 void UI_view2d_curRect_reset (View2D *v2d)
 {
        float width, height;
@@ -950,9 +1012,6 @@ View2DScrollers *UI_view2d_scrollers_calc(const bContext *C, View2D *v2d, short
        return scrollers;
 }
 
-/* XXX */
-extern void ui_rasterpos_safe(float x, float y, float aspect);
-
 /* Print scale marking along a time scrollbar */
 static void scroll_printstr(View2DScrollers *scrollers, float x, float y, float val, int power, short unit, char dir)
 {
index ffc435df4b413736fc22e73f38888eeae59edccc..b945e260fb997dc154d208f537b9ab567506acfa 100644 (file)
@@ -716,7 +716,7 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, wmEvent *event)
                        float dx, dy;
                        
                        /* calculate new delta transform, based on zooming mode */
-                       if (U.viewzoom == USER_ZOOM_SCALE) { // XXX store this setting as RNA prop?
+                       if (U.viewzoom == USER_ZOOM_SCALE) {
                                /* 'scale' zooming */
                                float dist;
                                
index bf37f89e18720f41a967e2e3219cfc906661108b..79e5fe243f856cb6324d39f1391741629f1c738f 100644 (file)
@@ -79,7 +79,6 @@ static SpaceLink *action_new(void)
        BLI_addtail(&saction->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for action");
@@ -92,23 +91,13 @@ static SpaceLink *action_new(void)
        ar->v2d.tot.xmax= 1000.0f;
        ar->v2d.tot.ymax= 0.0f;
        
-       ar->v2d.cur.xmin= -5.0f;
-       ar->v2d.cur.ymin= -75.0f;
-       ar->v2d.cur.xmax= 65.0f;
-       ar->v2d.cur.ymax= 5.0f;
-       
-       ar->v2d.min[0]= 0.0f;
        ar->v2d.min[1]= 0.0f;
-       
-       ar->v2d.max[0]= MAXFRAMEF;
        ar->v2d.max[1]= 1000.0f;
        
-       ar->v2d.minzoom= 0.01f;
-       ar->v2d.maxzoom= 50;
+       ar->v2d.scroll = V2D_SCROLL_RIGHT;
        
-       ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
-       ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
-       saction->v2d.keepzoom= V2D_LOCKZOOM_Y;
+       ar->v2d.align= saction->v2d.align= V2D_ALIGN_NO_POS_Y;
+       ar->v2d.keepzoom= saction->v2d.keepzoom= V2D_LOCKZOOM_Y;
        
        /* channel list region XXX */
        ar= MEM_callocN(sizeof(ARegion), "area region from do_versions");
@@ -150,7 +139,7 @@ static void action_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_TIMELINE, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "Action", SPACE_ACTION, 0);      /* XXX weak? */
@@ -193,7 +182,7 @@ void action_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void action_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void action_header_area_draw(const bContext *C, ARegion *ar)
@@ -262,11 +251,11 @@ void ED_spacetype_action(void)
        /* regions: channels */
        art= MEM_callocN(sizeof(ARegionType), "spacetype action region");
        art->regionid = RGN_TYPE_CHANNELS;
-       art->minsizex= 80;
+       art->minsizex = 200;
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
        
-//     art->init= action_channel_area_init;
-//     art->draw= action_channel_area_draw;
+       //art->init= action_channel_area_init;
+       //art->draw= action_channel_area_draw;
        
        BLI_addhead(&st->regiontypes, art);
        
index 9fc7ca123dc3db9a6b3892155662a5da9e872409..4c29d71f62a309ada2e5658370f2296a57181387 100644 (file)
@@ -77,7 +77,6 @@ static SpaceLink *buttons_new(void)
        BLI_addtail(&sbuts->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for buts");
@@ -102,6 +101,7 @@ static SpaceLink *buttons_new(void)
        sbuts->v2d.maxzoom= 1.21f;
        
        sbuts->v2d.scroll= 0;  // TODO: will we need scrollbars?
+       sbuts->v2d.align= V2D_ALIGN_NO_NEG_X|V2D_ALIGN_NO_NEG_Y;
        sbuts->v2d.keepzoom= V2D_KEEPZOOM|V2D_KEEPASPECT;
        sbuts->v2d.keeptot= 1;
        sbuts->v2d.cur= sbuts->v2d.tot;
@@ -146,7 +146,7 @@ static void buttons_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_CUSTOM, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "Buttons", SPACE_BUTS, 0);       /* XXX weak? */
@@ -189,7 +189,7 @@ void buttons_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void buttons_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void buttons_header_area_draw(const bContext *C, ARegion *ar)
index b6d87ee022408de782fa2cb0c106ba07c17dc814..972e852f481009de5d0133b80b342ebf75d69962 100644 (file)
@@ -81,7 +81,6 @@ static SpaceLink *file_new(void)
        BLI_addtail(&sfile->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for file");
@@ -132,7 +131,7 @@ static void file_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "File", SPACE_FILE, 0);  /* XXX weak? */
@@ -175,7 +174,7 @@ void file_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void file_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void file_header_area_draw(const bContext *C, ARegion *ar)
@@ -233,7 +232,6 @@ void ED_spacetype_file(void)
        /* regions: header */
        art= MEM_callocN(sizeof(ARegionType), "spacetype file region");
        art->regionid = RGN_TYPE_HEADER;
-       art->minsizey= HEADERY;
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
        
        art->init= file_header_area_init;
@@ -244,7 +242,6 @@ void ED_spacetype_file(void)
        /* regions: channels */
        art= MEM_callocN(sizeof(ARegionType), "spacetype file region");
        art->regionid = RGN_TYPE_CHANNELS;
-       art->minsizex= 80;
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
        
 //     art->init= file_channel_area_init;
index 6cefcd8321bca251535e659e6902ab931cecef92..7d34f724de2d58e694b754ffe880a73b852a9b43 100644 (file)
@@ -83,7 +83,6 @@ static SpaceLink *image_new(void)
        BLI_addtail(&simage->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for image");
@@ -132,7 +131,7 @@ static void image_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_VIEWCANVAS, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "Image", SPACE_IMAGE, 0);        /* XXX weak? */
@@ -175,7 +174,7 @@ void image_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void image_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void image_header_area_draw(const bContext *C, ARegion *ar)
index 7a54297a2f3c726e79967ebdab23898a62f62e2d..82bc6949c6117659188d1798116c59e3da5612bf 100644 (file)
@@ -76,7 +76,6 @@ static SpaceLink *info_new(void)
        BLI_addtail(&sinfo->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for info");
@@ -120,7 +119,7 @@ static void info_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_VIEWCANVAS, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "info", SPACE_INFO, 0);  /* XXX weak? */
@@ -163,7 +162,7 @@ void info_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void info_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void info_header_area_draw(const bContext *C, ARegion *ar)
index 4272f45ea6d8af9218facfdd551c770ab6d07f00..0afe38ea4700f0c9a8846c851c8c08a00c91bbcf 100644 (file)
@@ -77,7 +77,6 @@ static SpaceLink *ipo_new(void)
        BLI_addtail(&sipo->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* channels */
        ar= MEM_callocN(sizeof(ARegion), "main area for ipo");
@@ -195,7 +194,7 @@ static void ipo_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_TIMELINE, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "Ipo", SPACE_IPO, 0);    /* XXX weak? */
@@ -266,7 +265,7 @@ static void ipo_channel_area_draw(const bContext *C, ARegion *ar)
 /* add handlers, stuff you only do once or on area/region changes */
 static void ipo_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void ipo_header_area_draw(const bContext *C, ARegion *ar)
@@ -335,7 +334,7 @@ void ED_spacetype_ipo(void)
        /* regions: channels */
        art= MEM_callocN(sizeof(ARegionType), "spacetype ipo region");
        art->regionid = RGN_TYPE_CHANNELS;
-       art->minsizex= 80;
+       art->minsizex= 200;
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
        
 //     art->init= ipo_channel_area_init;
index 71d837249faae8edc6d712721d9949d0e8b54e7a..17f92c305026ca283a85e7d4f9217214096ca2bc 100644 (file)
@@ -77,7 +77,6 @@ static SpaceLink *nla_new(void)
        BLI_addtail(&snla->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for nla");
@@ -149,7 +148,7 @@ static void nla_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_TIMELINE, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "NLA", SPACE_NLA, 0);    /* XXX weak? */
@@ -192,7 +191,7 @@ void nla_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void nla_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void nla_header_area_draw(const bContext *C, ARegion *ar)
@@ -261,11 +260,11 @@ void ED_spacetype_nla(void)
        /* regions: channels */
        art= MEM_callocN(sizeof(ARegionType), "spacetype nla region");
        art->regionid = RGN_TYPE_CHANNELS;
-       art->minsizex= 80;
+       art->minsizex= 200;
        art->keymapflag= ED_KEYMAP_UI|ED_KEYMAP_VIEW2D;
        
-//     art->init= nla_channel_area_init;
-//     art->draw= nla_channel_area_draw;
+       //art->init= nla_channel_area_init;
+       //art->draw= nla_channel_area_draw;
        
        BLI_addhead(&st->regiontypes, art);
        
index 6569200196ccaea1a28a45404274679b8c96d23a..938cd2833612917d36c35cf1d8e1d7cd30311608 100644 (file)
@@ -75,7 +75,6 @@ static SpaceLink *node_new(void)
        BLI_addtail(&snode->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for node");
@@ -143,7 +142,7 @@ static void node_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_VIEWCANVAS, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "Node", SPACE_NODE, 0);  /* XXX weak? */
@@ -186,7 +185,7 @@ void node_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void node_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void node_header_area_draw(const bContext *C, ARegion *ar)
index cb0b29089b7b9ba86a6d8ed4eee5d23f97fd2bca..36afb206ab685fef40b0e420babc4ca7f2ead71b 100644 (file)
@@ -394,8 +394,7 @@ static void rna_table_cell_func(void *userdata, int row, int col, rcti *rct, uiB
 
 static void outliner_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
-
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy);
 }
 
 static void outliner_main_area_draw(const bContext *C, ARegion *ar)
@@ -505,7 +504,7 @@ static void outliner_main_area_free(ARegion *ar)
 /* add handlers, stuff you only do once or on area/region changes */
 static void outliner_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void outliner_header_area_draw(const bContext *C, ARegion *ar)
@@ -545,7 +544,6 @@ static SpaceLink *outliner_new(void)
        BLI_addtail(&soutliner->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for outliner");
index 081da6f5505a506ba3681ae288af6ddc1cb0f94a..bb31dd8dc03591ac526df05b96453f4da721a435 100644 (file)
@@ -77,7 +77,6 @@ static SpaceLink *script_new(void)
        BLI_addtail(&sscript->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for script");
@@ -130,7 +129,7 @@ static void script_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_VIEWCANVAS, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "Script", SPACE_SCRIPT, 0);      /* XXX weak? */
@@ -173,7 +172,7 @@ void script_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void script_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void script_header_area_draw(const bContext *C, ARegion *ar)
index b2e2aa67c2553c0f4b0dbd407302cca07674b5ef..714e6be24167610f453a4fbf1ca7ee933c1db340 100644 (file)
@@ -79,7 +79,6 @@ static SpaceLink *sequencer_new(void)
        BLI_addtail(&sseq->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for sequencer");
@@ -149,7 +148,7 @@ static void sequencer_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_TIMELINE, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "Sequencer", SPACE_SEQ, 0);      /* XXX weak? */
@@ -192,7 +191,7 @@ void sequencer_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void sequencer_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void sequencer_header_area_draw(const bContext *C, ARegion *ar)
index 18e2c01a2e87e059251b65816aa55a59bf5d5f4e..e02f7f4be121463386bcc52b887b7b750d851072 100644 (file)
@@ -77,7 +77,6 @@ static SpaceLink *sound_new(void)
        BLI_addtail(&ssound->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for sound");
@@ -108,6 +107,7 @@ static SpaceLink *sound_new(void)
        ar->v2d.scroll |= (V2D_SCROLL_LEFT);
        ar->v2d.keepzoom= 0;
        ar->v2d.keeptot= 0;
+       ar->v2d.keepzoom = V2D_LOCKZOOM_Y;
        
        
        return (SpaceLink *)ssound;
@@ -144,7 +144,7 @@ static void sound_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_TIMELINE, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "Sound", SPACE_SOUND, 0);        /* XXX weak? */
@@ -187,7 +187,7 @@ void sound_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void sound_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void sound_header_area_draw(const bContext *C, ARegion *ar)
index 5b52e43d0f2927a4f50ed454309d55f2f0ae508c..dee5c4b2d254b584c828ed0ac48bb585afb1d061 100644 (file)
@@ -78,7 +78,6 @@ static SpaceLink *text_new(void)
        BLI_addtail(&stext->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for text");
@@ -123,7 +122,7 @@ static void text_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_VIEWCANVAS, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "Text", SPACE_TEXT, 0);  /* XXX weak? */
@@ -174,7 +173,7 @@ static void text_keymap(struct wmWindowManager *wm)
 /* add handlers, stuff you only do once or on area/region changes */
 static void text_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void text_header_area_draw(const bContext *C, ARegion *ar)
index 9667e132e0967e061ab89d75b7917dca64a47abd..29426840653ccd505bc694c7bd94df56e71a1aef 100644 (file)
@@ -109,7 +109,7 @@ static void time_main_area_init(wmWindowManager *wm, ARegion *ar)
 {
        ListBase *keymap;
        
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_TIMELINE, ar->winx, ar->winy);
        
        /* own keymap */
        keymap= WM_keymap_listbase(wm, "TimeLine", SPACE_TIME, 0);      /* XXX weak? */
@@ -178,7 +178,7 @@ static void time_main_area_listener(ARegion *ar, wmNotifier *wmn)
 /* add handlers, stuff you only do once or on area/region changes */
 static void time_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void time_header_area_draw(const bContext *C, ARegion *ar)
@@ -223,7 +223,6 @@ static SpaceLink *time_new(void)
        BLI_addtail(&stime->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for time");
@@ -231,26 +230,18 @@ static SpaceLink *time_new(void)
        BLI_addtail(&stime->regionbase, ar);
        ar->regiontype= RGN_TYPE_WINDOW;
        
-       ar->v2d.tot.xmin= -4.0;
-       ar->v2d.tot.ymin= 0.0;
-       ar->v2d.tot.xmax= (float)EFRA + 4.0;
-       ar->v2d.tot.ymax= 50.0;
+               /* only need to set y-locks for view2d of main area, 
+                * as the rest is taken care of by View2D preset for TimeGrids 
+                */
+       ar->v2d.min[1]= 20.0;
+       ar->v2d.max[1]= 20.0; 
        
-       ar->v2d.cur= ar->v2d.tot;
+       ar->v2d.cur.ymin= ar->v2d.tot.ymin= 0.0f;
+       ar->v2d.cur.ymax= ar->v2d.tot.ymax= 20.0f;
 
-       ar->v2d.min[0]= 1.0;
-       ar->v2d.min[1]= 50.0;
-
-       ar->v2d.max[0]= 32000.0;
-       ar->v2d.max[1]= 50.0; 
-
-       ar->v2d.minzoom= 0.1f;
-       ar->v2d.maxzoom= 10.0;
-
-       ar->v2d.scroll |= (V2D_SCROLL_BOTTOM|V2D_SCROLL_SCALE_HORIZONTAL);
-       ar->v2d.align |= V2D_ALIGN_NO_NEG_Y;
-       ar->v2d.keepofs |= V2D_LOCKOFS_Y;
-       ar->v2d.keepzoom |= V2D_LOCKZOOM_Y;
+       ar->v2d.align = V2D_ALIGN_NO_NEG_Y;
+       ar->v2d.keepofs = V2D_LOCKOFS_Y;
+       ar->v2d.keepzoom = V2D_LOCKZOOM_Y;
 
        return (SpaceLink*)stime;
 }
index 015a931d806067c18b632516905026e807e9eb93..9ccc7afe363c6099de3678a27ed3ccf5efd8257d 100644 (file)
@@ -101,7 +101,6 @@ static SpaceLink *view3d_new(void)
        BLI_addtail(&vd->regionbase, ar);
        ar->regiontype= RGN_TYPE_HEADER;
        ar->alignment= RGN_ALIGN_BOTTOM;
-       UI_view2d_header_default(&ar->v2d);
        
        /* main area */
        ar= MEM_callocN(sizeof(ARegion), "main area for view3d");
@@ -202,7 +201,7 @@ static void view3d_main_area_draw(const bContext *C, ARegion *ar)
 /* add handlers, stuff you only do once or on area/region changes */
 static void view3d_header_area_init(wmWindowManager *wm, ARegion *ar)
 {
-       UI_view2d_size_update(&ar->v2d, ar->winx, ar->winy);
+       UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_HEADER, ar->winx, ar->winy);
 }
 
 static void view3d_header_area_draw(const bContext *C, ARegion *ar)
index 96b3febf7f367361305f24ffde7d77a90c484910..ff96e9092e5a26171062c798f5ab21383ab67605 100644 (file)
@@ -93,7 +93,7 @@ typedef struct View2D {
        /* within region view2d vertical locking */
 #define V2D_VIEWSYNC_Y         (1<<1)
        /* view settings need to be set still... */
-#define V2D_NEEDS_INIT         (1<<10)
+#define V2D_IS_INITIALISED             (1<<10)
 
 /* scroller flags for View2D (v2d->scroll) */
        /* left scrollbar */