* Some code optimizations to panel collapse code, to avoid calculations for each...
authorThomas Dinges <blender@dingto.org>
Mon, 28 May 2012 14:57:38 +0000 (14:57 +0000)
committerThomas Dinges <blender@dingto.org>
Mon, 28 May 2012 14:57:38 +0000 (14:57 +0000)
source/blender/editors/interface/interface_panel.c

index 92d92359814df796be28f512a00f77e7c6ad3cd5..21f87029cb0cd3a7ef0eda466be4b4ffbe111f6f 100644 (file)
@@ -166,13 +166,13 @@ static int panels_re_align(ScrArea *sa, ARegion *ar, Panel **r_pa)
 
 static void panels_collapse_all(ScrArea *sa, ARegion *ar)
 {
-       Panel *pa;
-       int align = panel_aligned(sa, ar);
+    Panel *pa;
+    int flag = ((panel_aligned(sa, ar)==BUT_HORIZONTAL)? PNL_CLOSEDX: PNL_CLOSEDY);
 
-       for (pa= ar->panels.first; pa; pa= pa->next) {
-                       if (pa->type && !(pa->type->flag & PNL_NO_HEADER))
-                               pa->flag = (align==BUT_HORIZONTAL)? PNL_CLOSEDX: PNL_CLOSEDY;
-       }
+    for (pa= ar->panels.first; pa; pa= pa->next) {
+        if (pa->type && !(pa->type->flag & PNL_NO_HEADER))
+            pa->flag = flag;
+    }
 }