Fixes transform gizmo position when node has default transform
Changes made:
* Added dirty bit for SpatialEditorSelectedItem's last_xform
* SpatialEditorViewport checks that dirt bit too before skipping the selection
(cherry picked from commit 19825436d4
)
This commit is contained in:
parent
31fb54742b
commit
a10a21f407
|
@ -2392,9 +2392,10 @@ void SpatialEditorViewport::_notification(int p_what) {
|
||||||
Transform t = sp->get_global_gizmo_transform();
|
Transform t = sp->get_global_gizmo_transform();
|
||||||
|
|
||||||
exist = true;
|
exist = true;
|
||||||
if (se->last_xform == t)
|
if (se->last_xform == t && !se->last_xform_dirty)
|
||||||
continue;
|
continue;
|
||||||
changed = true;
|
changed = true;
|
||||||
|
se->last_xform_dirty = false;
|
||||||
se->last_xform = t;
|
se->last_xform = t;
|
||||||
|
|
||||||
VisualInstance *vi = Object::cast_to<VisualInstance>(sp);
|
VisualInstance *vi = Object::cast_to<VisualInstance>(sp);
|
||||||
|
|
|
@ -469,10 +469,14 @@ public:
|
||||||
Transform original; // original location when moving
|
Transform original; // original location when moving
|
||||||
Transform original_local;
|
Transform original_local;
|
||||||
Transform last_xform; // last transform
|
Transform last_xform; // last transform
|
||||||
|
bool last_xform_dirty;
|
||||||
Spatial *sp;
|
Spatial *sp;
|
||||||
RID sbox_instance;
|
RID sbox_instance;
|
||||||
|
|
||||||
SpatialEditorSelectedItem() { sp = NULL; }
|
SpatialEditorSelectedItem() {
|
||||||
|
sp = NULL;
|
||||||
|
last_xform_dirty = true;
|
||||||
|
}
|
||||||
~SpatialEditorSelectedItem();
|
~SpatialEditorSelectedItem();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue