From af346f991827fef81b21fe30370d84bc338d6461 Mon Sep 17 00:00:00 2001 From: Antony Riakiotakis Date: Mon, 13 Oct 2014 19:55:19 +0200 Subject: [PATCH] Some corrections to the pie spawning code to account for nested pies. --- .../editors/interface/interface_regions.c | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/source/blender/editors/interface/interface_regions.c b/source/blender/editors/interface/interface_regions.c index 49823d4e472..e743cb50a83 100644 --- a/source/blender/editors/interface/interface_regions.c +++ b/source/blender/editors/interface/interface_regions.c @@ -2729,17 +2729,20 @@ uiPieMenu *uiPieMenuBegin(struct bContext *C, const char *title, int icon, const pie->block_radial->puphash = ui_popup_menu_hash(title); pie->block_radial->flag |= UI_BLOCK_RADIAL; - if (win->last_pie_event != EVENT_NONE) - event_type = win->last_pie_event; - else - event_type = event->type; - - pie->block_radial->pie_data.event = event_type; - win->lock_pie_event = event_type; - /* if pie is spawned by a left click, it is always assumed to be click style */ - if (event_type == LEFTMOUSE) { - pie->block_radial->flag |= UI_PIE_CLICK_STYLE; + if (event->type == LEFTMOUSE) { + pie->block_radial->pie_data.flags |= UI_PIE_CLICK_STYLE; + pie->block_radial->pie_data.event = EVENT_NONE; + win->lock_pie_event = EVENT_NONE; + } + else { + if (win->last_pie_event != EVENT_NONE) + event_type = win->last_pie_event; + else + event_type = event->type; + + pie->block_radial->pie_data.event = event_type; + win->lock_pie_event = event_type; } pie->layout = uiBlockLayout(pie->block_radial, UI_LAYOUT_VERTICAL, UI_LAYOUT_PIEMENU, 0, 0, 200, 0, 0, style);