diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-11-15 16:32:23 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-11-15 16:40:10 +0300 |
commit | c1e48c0ff085f9f575dc596c9e97f5f67137c8a6 (patch) | |
tree | 8b4142ef14ff6401351f28e04aa0633c01d93de8 /source/blender/editors/interface/interface.c | |
parent | 694f15dee37e46eb4dc3843bdeb5168366cc1f11 (diff) |
UI: cleanup next/prev order in menu code
Recent flag re-order broke it since bits overlap, but logic here was far too complicated & fragile,
Checked the type of each button when testing which direction to handle events as well as block direction.
Now store the block-flipped state as a flag.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index a8a1f283ccb..a64ec7fca2b 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -3270,6 +3270,9 @@ static void ui_def_but_rna__menu(bContext *UNUSED(C), uiLayout *layout, void *bu if (free) { MEM_freeN(item_array); } + + BLI_assert((block->flag & UI_BLOCK_IS_FLIP) == 0); + block->flag |= UI_BLOCK_IS_FLIP; } /** @@ -3888,6 +3891,8 @@ void UI_block_order_flip(uiBlock *block) but->rect.ymax = centy - (but->rect.ymax - centy); SWAP(float, but->rect.ymin, but->rect.ymax); } + + block->flag ^= UI_BLOCK_IS_FLIP; } |