diff options
author | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-11-22 21:49:06 +0400 |
---|---|---|
committer | Lukas Toenne <lukas.toenne@googlemail.com> | 2011-11-22 21:49:06 +0400 |
commit | b450d3c3b6585cefe52d007c0088c4dc7b2e78ec (patch) | |
tree | fc4cb80a0b3c3940b8529b8620dd7bff49a10467 /source/blender/editors/interface/interface.c | |
parent | 470cfd4aeb010b4a674d27ace3cfffad2ca6c4f0 (diff) |
Fix for long-standing TODO item: Clicking on overlapping nodes would activate buttons below.
This patch adds a new CLIP_EVENTS flag for uiBlock, which will prevent the ui_but_find_mouse_over search function from looking into "lower" uiBlocks (i.e. those further back in the list). The order of block creation for nodes has also been updated to use the z-ordering (just the nodetree->nodes list).
In order for this to work, the bounding box values of the uiBlocks have to be set explicitely to fit the node size, those are usually either zero or calculated from the internal buttons.
Diffstat (limited to 'source/blender/editors/interface/interface.c')
-rw-r--r-- | source/blender/editors/interface/interface.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface.c b/source/blender/editors/interface/interface.c index 4b7adbc1064..86961cd84dc 100644 --- a/source/blender/editors/interface/interface.c +++ b/source/blender/editors/interface/interface.c @@ -434,6 +434,15 @@ void uiCenteredBoundsBlock(uiBlock *block, int addval) block->dobounds= UI_BLOCK_BOUNDS_POPUP_CENTER; } +void uiExplicitBoundsBlock(uiBlock *block, int minx, int miny, int maxx, int maxy) +{ + block->minx = minx; + block->miny = miny; + block->maxx = maxx; + block->maxy = maxy; + block->dobounds = 0; +} + /* ************** LINK LINE DRAWING ************* */ /* link line drawing is not part of buttons or theme.. so we stick with it here */ |