From d02b6707f9431341db0cdfd986ef9a759154816f Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Mon, 28 May 2012 14:57:38 +0000 Subject: [PATCH] * Some code optimizations to panel collapse code, to avoid calculations for each panel. Suggested by "Bao 2". --- source/blender/editors/interface/interface_panel.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 92d92359814..21f87029cb0 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -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; + } }