Button alignment error in Particle panel (set 'static').

Appeared to be a missing check in the alignment code even. :)
This commit is contained in:
2006-06-22 12:25:28 +00:00
parent 75c6fe760f
commit 7f72afa650
2 changed files with 10 additions and 3 deletions

View File

@@ -2262,6 +2262,7 @@ static void object_panel_particles(Object *ob)
uiBut *but;
PartEff *paf= give_parteff(ob);
/* the panelname "Particles " has a space to exclude previous saved panel "Particles" */
block= uiNewBlock(&curarea->uiblocks, "object_panel_particles", UI_EMBOSS, UI_HELV, curarea->win);
if(uiNewPanel(curarea, block, "Particles ", "Physics", 320, 0, 318, 204)==0) return;

View File

@@ -5541,8 +5541,9 @@ void uiBlockEndAlign(uiBlock *block)
{
uiBut *prev, *but=NULL, *next;
int flag= 0, cols=0, rows=0;
int theme= BIF_GetThemeValue(TH_BUT_DRAWTYPE);
if ( !((BIF_GetThemeValue(TH_BUT_DRAWTYPE) == 0) || (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == 1) || (BIF_GetThemeValue(TH_BUT_DRAWTYPE) == 2))) {
if ( !(theme==0 || theme==1 || theme==2) ) {
block->flag &= ~UI_BUT_ALIGN; // all 4 flags
return;
}
@@ -5567,6 +5568,7 @@ void uiBlockEndAlign(uiBlock *block)
/* rows==0: 1 row, cols==0: 1 collumn */
/* note; how it uses 'flag' in loop below (either set it, or OR it) is confusing */
prev= NULL;
while(but) {
next= but->next;
@@ -5620,9 +5622,13 @@ void uiBlockEndAlign(uiBlock *block)
}
else { /* next button switches to new row */
if( (flag & UI_BUT_ALIGN_TOP)==0) { /* stil top row */
flag= UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT;
if(prev)
flag= UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT;
else
flag |= UI_BUT_ALIGN_DOWN;
}
else flag |= UI_BUT_ALIGN_TOP;
else
flag |= UI_BUT_ALIGN_TOP;
}
}