[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21608] branches/blender2.5/blender/source /blender/editors/interface/interface_panel.c: 2.5: fix for closed panels not resizing properly.

Brecht Van Lommel brecht at blender.org
Thu Jul 16 00:58:34 CEST 2009


Revision: 21608
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21608
Author:   blendix
Date:     2009-07-16 00:58:34 +0200 (Thu, 16 Jul 2009)

Log Message:
-----------
2.5: fix for closed panels not resizing properly.

Modified Paths:
--------------
    branches/blender2.5/blender/source/blender/editors/interface/interface_panel.c

Modified: branches/blender2.5/blender/source/blender/editors/interface/interface_panel.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/interface/interface_panel.c	2009-07-15 22:58:12 UTC (rev 21607)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface_panel.c	2009-07-15 22:58:34 UTC (rev 21608)
@@ -268,14 +268,19 @@
 		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;
 	}
 }
 





More information about the Bf-blender-cvs mailing list