2.5: fix for closed panels not resizing properly.

This commit is contained in:
2009-07-15 22:58:34 +00:00
parent 7c2fb42195
commit acb07bf013

View File

@@ -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;
}
}