Fix T73594: Scale Cage sometimes has incorrect center in edit mode

Differential Revision: https://developer.blender.org/D6803
This commit is contained in:
Germano Cavalcante 2020-05-19 16:29:31 -03:00
parent 5201bc9dd4
commit d6cc16831a
Notes: blender-bot 2024-01-31 11:35:08 +01:00
Referenced by issue #73594, Scale Cage sometimes has incorrect center in edit mode
1 changed files with 9 additions and 9 deletions

View File

@ -2199,6 +2199,15 @@ static void WIDGETGROUP_xform_cage_refresh(const bContext *C, wmGizmoGroup *gzgr
WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, true);
}
else {
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = OBACT(view_layer);
if (ob && ob->mode & OB_MODE_EDIT) {
copy_m4_m4(gz->matrix_space, ob->obmat);
}
else {
unit_m4(gz->matrix_space);
}
gizmo_prepare_mat(C, rv3d, &tbounds);
WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, false);
@ -2256,15 +2265,6 @@ static void WIDGETGROUP_xform_cage_message_subscribe(const bContext *C,
static void WIDGETGROUP_xform_cage_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
{
struct XFormCageWidgetGroup *xgzgroup = gzgroup->customdata;
wmGizmo *gz = xgzgroup->gizmo;
ViewLayer *view_layer = CTX_data_view_layer(C);
Object *ob = OBACT(view_layer);
if (ob && ob->mode & OB_MODE_EDIT) {
copy_m4_m4(gz->matrix_space, ob->obmat);
}
else {
unit_m4(gz->matrix_space);
}
RegionView3D *rv3d = CTX_wm_region_view3d(C);
{