2.5
authorJoshua Leung <aligorith@gmail.com>
Mon, 12 Jan 2009 22:54:30 +0000 (22:54 +0000)
committerJoshua Leung <aligorith@gmail.com>
Mon, 12 Jan 2009 22:54:30 +0000 (22:54 +0000)
* Tweaked a few incorrect comments in Constraints code
* Made Sequencer use View2D system correctly (only looked at the 'time-grid' thing so far).

source/blender/blenkernel/BKE_constraint.h
source/blender/blenkernel/intern/constraint.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/space_sequencer/sequencer_draw.c
source/blender/editors/space_sequencer/space_sequencer.c

index 8fe71673a9848eae9d9e6742b5ce9b0db3cc6741..043062a2871cceb3d43b88a324408d455a703fbc 100644 (file)
@@ -79,7 +79,7 @@ typedef struct bConstraintTypeInfo {
        void (*relink_data)(struct bConstraint *con);
                /* copy any special data that is allocated separately (optional) */
        void (*copy_data)(struct bConstraint *con, struct bConstraint *src);
-               /* set settings for data that will be used for bConstraint.data (memory already allocated) */
+               /* set settings for data that will be used for bConstraint.data (memory already allocated using MEM_callocN) */
        void (*new_data)(void *cdata);
        
        /* target handling function pointers */
index 52448fca8d622b9136e73f55b552aad5467ec4ea..f83428766f92282f6278480319a23c931bf9dd8d 100644 (file)
@@ -3389,7 +3389,7 @@ void copy_constraints (ListBase *dst, ListBase *src)
        dst->first= dst->last= NULL;
        BLI_duplicatelist(dst, src);
        
-       for (con=dst->first, srccon=src->first; con; srccon=srccon->next, con=con->next) {
+       for (con=dst->first, srccon=src->first; con && srccon; srccon=srccon->next, con=con->next) {
                bConstraintTypeInfo *cti= constraint_get_typeinfo(con);
                
                /* make a new copy of the constraint's data */
index 8c979a68d9a11376cd7987ef085de5cb329bf096..82fe3199eafcfe2c876e2469b4c013a41321fac6 100644 (file)
@@ -5268,7 +5268,6 @@ 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:
@@ -5300,7 +5299,6 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                                ar->v2d.scroll |= (V2D_SCROLL_RIGHT);
                                ar->v2d.align = V2D_ALIGN_NO_POS_Y;
                                ar->v2d.flag |= V2D_VIEWSYNC_AREA_VERTICAL;
-                               //ar->v2d.flag |= V2D_IS_INITIALISED;
                                break;
                        }
                        case SPACE_ACTION:
@@ -5326,7 +5324,6 @@ static void area_add_window_regions(ScrArea *sa, SpaceLink *sl, ListBase *lb)
                                ar->v2d.keepzoom= V2D_LOCKZOOM_Y;
                                ar->v2d.align= V2D_ALIGN_NO_POS_Y;
                                ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
-                               //ar->v2d.flag |= V2D_IS_INITIALISED;
                                break;
                        }
                        case SPACE_SEQ:
@@ -5336,6 +5333,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.align= V2D_ALIGN_NO_NEG_Y;
                                ar->v2d.flag |= V2D_IS_INITIALISED;
                                break;
                        }
index b8b8f4af36c639bbbf1e076455e31edc2e14cab0..9c91d95fc27af98cce0f35baab3361cc54d5c7e5 100644 (file)
@@ -944,7 +944,8 @@ void seq_home(Scene *scene, ARegion *ar, SpaceSeq *sseq)
 }
 
 #if 0
-/* XXX */
+/* XXX - these should really be made to use View2D instead of so wacko private system - Aligorith */
+
 void seq_viewzoom(SpaceSeq *sseq, unsigned short event, int invert)
 {
 
@@ -1127,7 +1128,7 @@ void drawseqspace(const bContext *C, ARegion *ar)
        UI_view2d_view_restore(C);
 
        /* scrollers */
-       scrollers= UI_view2d_scrollers_calc(C, v2d, 10, V2D_GRID_CLAMP, V2D_ARG_DUMMY, V2D_ARG_DUMMY);
+       scrollers= UI_view2d_scrollers_calc(C, v2d, V2D_UNIT_SECONDSSEQ, V2D_GRID_CLAMP, V2D_UNIT_VALUES, V2D_GRID_CLAMP);
        UI_view2d_scrollers_draw(C, v2d, scrollers);
        UI_view2d_scrollers_free(scrollers);
 }
index 7adf042d13a289acce5bd11161a5deedaf629775..b10453b41361ee273e857899b408bc6d1ae26389 100644 (file)
@@ -111,6 +111,7 @@ static SpaceLink *sequencer_new(const bContext *C)
        ar->v2d.scroll |= (V2D_SCROLL_LEFT|V2D_SCROLL_SCALE_VERTICAL);
        ar->v2d.keepzoom= 0;
        ar->v2d.keeptot= 0;
+       ar->v2d.align= V2D_ALIGN_NO_NEG_Y;
        
        return (SpaceLink *)sseq;
 }