Fix spin-gizmo button tool-tip placement

gizmo_button2d_bounds result wasn't valid when the gizmo was part
of a 3D gizmo group.

Regression in cf6d17a6aa
This commit is contained in:
2021-04-19 17:17:49 +10:00
parent 063c9938f1
commit 9175911ffa
4 changed files with 43 additions and 11 deletions

View File

@@ -1469,9 +1469,10 @@ ARegion *UI_tooltip_create_from_gizmo(bContext *C, wmGizmo *gz)
*/
if (gz->type->screen_bounds_get) {
rcti bounds;
gz->type->screen_bounds_get(C, gz, &bounds);
init_position[0] = bounds.xmin;
init_position[1] = bounds.ymin;
if (gz->type->screen_bounds_get(C, gz, &bounds)) {
init_position[0] = bounds.xmin;
init_position[1] = bounds.ymin;
}
}
return ui_tooltip_create_with_data(C, data, init_position, NULL, aspect);