UI: Fix crash using drag-toggle over window bounds with button callback
Steps to reproduce: * Go to modifier context in properties editor * Add modifier, collapse it * Press down LMB over collapse button of modifier, hold it * Drag over pin-icon in properties editor (to keep fixed data-block displayed) * Drag outside of window bounds (should crash) Also could've solved by getting space data from callback arguments instead of context, but this fix is much nicer (though not totally un-risky).
This commit is contained in:
@@ -1266,6 +1266,10 @@ static bool ui_drag_toggle_set_xy_xy(
|
||||
}
|
||||
}
|
||||
}
|
||||
if (changed) {
|
||||
/* apply now, not on release (or if handlers are cancelled for whatever reason) */
|
||||
ui_apply_but_funcs_after(C);
|
||||
}
|
||||
|
||||
return changed;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user