WM: add support for drag events
This allows for a single key to be mapped to both release and drag, useful for pie menus to share a key with a different action.
This commit is contained in:
@@ -150,8 +150,16 @@ uiPieMenu *UI_pie_menu_begin(struct bContext *C, const char *title, int icon, co
|
||||
}
|
||||
|
||||
pie->layout = UI_block_layout(pie->block_radial, UI_LAYOUT_VERTICAL, UI_LAYOUT_PIEMENU, 0, 0, 200, 0, 0, style);
|
||||
pie->mx = event->x;
|
||||
pie->my = event->y;
|
||||
|
||||
/* Open from where we started dragging. */
|
||||
if (event->val == KM_CLICK_DRAG) {
|
||||
pie->mx = event->prevclickx;
|
||||
pie->my = event->prevclicky;
|
||||
}
|
||||
else {
|
||||
pie->mx = event->x;
|
||||
pie->my = event->y;
|
||||
}
|
||||
|
||||
/* create title button */
|
||||
if (title[0]) {
|
||||
|
||||
Reference in New Issue
Block a user