Code cleanup: Minor addition to rB254aa8f3a0fbffcbcb886cfaa81b630ae3e9bb78: handle copying of drawflag in ui_but_update_from_old_block()

Note that this is not really needed currently, as the only flag being copied here (UI_BUT_REDALERT) remained in but->flag. However, since we'll have more flags in drawflag now, it's better to explicitly handle this situation...
This func could use some cleanup anyway (a bunch of commented code here)...

Thanks to Campbell for noting this!
This commit is contained in:
Bastien Montagne 2013-11-21 20:25:31 +01:00
parent 2479594351
commit 811ce5a696
1 changed files with 3 additions and 1 deletions

View File

@ -613,6 +613,7 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
{
/* flags from the buttons we want to refresh, may want to add more here... */
const int flag_copy = UI_BUT_REDALERT;
const int drawflag_copy = 0; /* None currently. */
uiBlock *oldblock;
uiBut *oldbut, *but = *butpp;
@ -670,8 +671,9 @@ static int ui_but_update_from_old_block(const bContext *C, uiBlock *block, uiBut
SWAP(char *, oldbut->poin, but->poin);
SWAP(void *, oldbut->func_argN, but->func_argN);
}
oldbut->flag = (oldbut->flag & ~flag_copy) | (but->flag & flag_copy);
oldbut->drawflag = (oldbut->drawflag & ~drawflag_copy) | (but->drawflag & drawflag_copy);
/* copy hardmin for list rows to prevent 'sticking' highlight to mouse position
* when scrolling without moving mouse (see [#28432]) */