== Action Editor - Scrolling Fix ==
authorJoshua Leung <aligorith@gmail.com>
Tue, 19 Jun 2007 11:52:14 +0000 (11:52 +0000)
committerJoshua Leung <aligorith@gmail.com>
Tue, 19 Jun 2007 11:52:14 +0000 (11:52 +0000)
This fixes a problem introduced in http://lists.blender.org/pipermail/bf-blender-cvs/2007-May/010005.html

Now channels in older files will be in the view again upon loading.

source/blender/blenloader/intern/readfile.c
source/blender/src/space.c

index 7cfef325f6340658b5cf39ceab2465054ead958b..f4004047c2e1328b06c42ca4453db73cfd903a32 100644 (file)
@@ -6480,9 +6480,11 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
        }
        if(main->versionfile <= 244) {
                Scene *sce;
+               bScreen *sc;
 
                if(main->versionfile != 244 || main->subversionfile < 2) {
                        Mesh *me;
+                       
                        for(sce= main->scene.first; sce; sce= sce->id.next)
                                sce->r.mode |= R_SSS;
 
@@ -6503,6 +6505,28 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                        }
                                }
                        }
+                       
+                       /* correct older action editors - incorrect scrolling */
+                       for(sc= main->screen.first; sc; sc= sc->id.next) {
+                               ScrArea *sa;
+                               sa= sc->areabase.first;
+                               while(sa) {
+                                       SpaceLink *sl;
+
+                                       for (sl= sa->spacedata.first; sl; sl= sl->next) {
+                                               if(sl->spacetype==SPACE_ACTION) {
+                                                       SpaceAction *saction= (SpaceAction*) sl;
+                                                       
+                                                       saction->v2d.tot.ymin= -1000.0;
+                                                       saction->v2d.tot.ymax= 0.0;
+                                                       
+                                                       saction->v2d.cur.ymin= -75.0;
+                                                       saction->v2d.cur.ymax= 5.0;
+                                               }
+                                       }
+                                       sa = sa->next;
+                       }
+               }
                }
        }
 
index e308546844208f94b27f42911ef6e037d3fc952a..31e890db01af56847bc0a71c76c08aebe1636b50 100644 (file)
@@ -4569,14 +4569,14 @@ static void init_actionspace(ScrArea *sa)
        saction->blockscale= 0.7;
 
        saction->v2d.tot.xmin= 1.0;
-       saction->v2d.tot.ymin=  0.0;
+       saction->v2d.tot.ymin= -1000.0;
        saction->v2d.tot.xmax= 1000.0;
-       saction->v2d.tot.ymax= 1000.0;
+       saction->v2d.tot.ymax= 0.0;
        
        saction->v2d.cur.xmin= -5.0;
-       saction->v2d.cur.ymin= 0.0;
+       saction->v2d.cur.ymin= -75.0;
        saction->v2d.cur.xmax= 65.0;
-       saction->v2d.cur.ymax= 1000.0;
+       saction->v2d.cur.ymax= 5.0;
 
        saction->v2d.min[0]= 0.0;
        saction->v2d.min[1]= 0.0;