From acb07bf0139f8071668ffab915ba0704adabc7a6 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Wed, 15 Jul 2009 22:58:34 +0000 Subject: 2.5: fix for closed panels not resizing properly. --- source/blender/editors/interface/interface_panel.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'source/blender/editors/interface/interface_panel.c') diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c index 363717c29d3..377861ae0d7 100644 --- a/source/blender/editors/interface/interface_panel.c +++ b/source/blender/editors/interface/interface_panel.c @@ -268,14 +268,19 @@ void uiEndPanel(uiBlock *block, int width, int height) pa->sizex= width; pa->sizey= height; } - else if(!(width == 0 || height == 0)) { - if(pa->sizex != width || pa->sizey != height) { + else { + /* check if we need to do an animation */ + if(!ELEM(width, 0, pa->sizex) || !ELEM(height, 0, pa->sizey)) { pa->runtime_flag |= PNL_ANIM_ALIGN; - pa->ofsy += pa->sizey-height; + if(height != 0) + pa->ofsy += pa->sizey-height; } - pa->sizex= width; - pa->sizey= height; + /* update width/height if non-zero */ + if(width != 0) + pa->sizex= width; + if(height != 0) + pa->sizey= height; } } -- cgit v1.2.3