Commit: fa7188c7da21eb942ea10834170af11ce834747a
Author: Julian Eisel
Date:   Sat Jun 6 12:19:14 2015 +0200
Branches: UI-graphical-redesign
https://developer.blender.org/rBfa7188c7da21eb942ea10834170af11ce834747a

Fix Clip Editor not using correct scrollbars in Graph/Dopesheet view

===================================================================

M       source/blender/blenloader/intern/versioning_270.c
M       source/blender/editors/space_clip/space_clip.c

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_270.c 
b/source/blender/blenloader/intern/versioning_270.c
index e9f3dd5..377ef42 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -852,30 +852,38 @@ void blo_do_versions_270(FileData *fd, Library 
*UNUSED(lib), Main *main)
                        ScrArea *sa;
 
                        for (sa = screen->areabase.first; sa; sa = sa->next) {
-                               ARegion *ar;
+                               const char needed_type = (sa->spacetype == 
SPACE_CLIP) ? RGN_TYPE_PREVIEW : RGN_TYPE_WINDOW;
+                               ARegion *ar = BKE_area_find_region_type(sa, 
needed_type);
                                SpaceLink *sl;
 
-                               for (ar = sa->regionbase.first; ar; ar = 
ar->next) {
-                                       if (ar->regiontype == RGN_TYPE_WINDOW) {
-                                               break;
-                                       }
-                               }
+                               if (ar == NULL)
+                                       continue;
 
-                               if (ar) {
-                                       for (sl = sa->spacedata.first; sl; sl = 
sl->next) {
-                                               switch (sl->spacetype) {
-                                                       case SPACE_TIME:
-                                                       case SPACE_ACTION:
-                                                       case SPACE_NLA:
+                               for (sl = sa->spacedata.first; sl; sl = 
sl->next) {
+                                       switch (sl->spacetype) {
+                                               case SPACE_TIME:
+                                               case SPACE_ACTION:
+                                               case SPACE_NLA:
+                                                       ar->v2d.flag |= 
V2D_USES_UNITS_HORIZONTAL;
+                                                       break;
+                                               case SPACE_IPO:
+                                               case SPACE_SEQ:
+                                                       ar->v2d.flag |= 
(V2D_USES_UNITS_HORIZONTAL | V2D_USES_UNITS_VERTICAL);
+                                                       break;
+                                               case SPACE_CLIP:
+                                               {
+                                                       SpaceClip *sc = 
(SpaceClip *)sl;
+
+                                                       if (sc->view == 
SC_VIEW_DOPESHEET) {
                                                                ar->v2d.flag |= 
V2D_USES_UNITS_HORIZONTAL;
-                                                               break;
-                                                       case SPACE_IPO:
-                                                       case SPACE_SEQ:
+                                                       }
+                                                       else if (sc->view == 
SC_VIEW_GRAPH) {
                                                                ar->v2d.flag |= 
(V2D_USES_UNITS_HORIZONTAL | V2D_USES_UNITS_VERTICAL);
-                                                               break;
-                                                       default:
-                                                               break;
+                                                       }
+                                                       break;
                                                }
+                                               default:
+                                                       break;
                                        }
                                }
                        }
diff --git a/source/blender/editors/space_clip/space_clip.c 
b/source/blender/editors/space_clip/space_clip.c
index 5ba82f7..25cfcc2 100644
--- a/source/blender/editors/space_clip/space_clip.c
+++ b/source/blender/editors/space_clip/space_clip.c
@@ -104,7 +104,7 @@ static void init_preview_region(const bContext *C, ARegion 
*ar)
                ar->v2d.keepzoom = V2D_LOCKZOOM_Y;
                ar->v2d.keepofs = V2D_KEEPOFS_Y;
                ar->v2d.align = V2D_ALIGN_NO_POS_Y;
-               ar->v2d.flag = V2D_VIEWSYNC_AREA_VERTICAL;
+               ar->v2d.flag = (V2D_VIEWSYNC_AREA_VERTICAL | 
V2D_USES_UNITS_HORIZONTAL);
        }
        else {
                ar->v2d.tot.xmin = 0.0f;
@@ -128,7 +128,7 @@ static void init_preview_region(const bContext *C, ARegion 
*ar)
                ar->v2d.keepzoom = 0;
                ar->v2d.keepofs = 0;
                ar->v2d.align = 0;
-               ar->v2d.flag = 0;
+               ar->v2d.flag = (V2D_USES_UNITS_HORIZONTAL | 
V2D_USES_UNITS_VERTICAL);
 
                ar->v2d.keeptot = 0;
        }
@@ -143,8 +143,8 @@ static void reinit_preview_region(const bContext *C, 
ARegion *ar)
                        init_preview_region(C, ar);
        }
        else {
-               if (ar->v2d.flag & V2D_VIEWSYNC_AREA_VERTICAL)
-                       init_preview_region(C, ar);
+               /* XXX check with sergey */
+               init_preview_region(C, ar);
        }
 }

_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to