Tighten editor scene mutation boundary

This commit is contained in:
2026-04-28 17:53:36 +08:00
parent 357dc136fe
commit b67af931de
12 changed files with 290 additions and 62 deletions

View File

@@ -282,6 +282,26 @@ public:
return m_beforeSnapshot.IsValid();
}
bool ApplyWorldTransformPreview(
std::uint64_t entityId,
const Vector3& position,
const Quaternion& rotation) override {
return m_sceneRuntime != nullptr &&
m_sceneRuntime->ApplyTransformToolWorldPreview(
entityId,
position,
rotation);
}
bool ApplyLocalScalePreview(
std::uint64_t entityId,
const Vector3& localScale) override {
return m_sceneRuntime != nullptr &&
m_sceneRuntime->ApplyTransformToolLocalScalePreview(
entityId,
localScale);
}
void FinalizeInteractiveChange() override {
if (m_sceneRuntime == nullptr || !HasPendingInteractiveChange()) {
return;
@@ -536,13 +556,13 @@ bool SceneViewportTransformGizmo::UpdateDrag(EditorSceneRuntime& sceneRuntime) {
state.rotateGizmo,
state.scaleGizmo)) {
case ActiveTransformGizmoKind::Move:
state.moveGizmo.UpdateDrag(state.moveContext);
state.moveGizmo.UpdateDrag(state.moveContext, state.undoBridge);
return true;
case ActiveTransformGizmoKind::Rotate:
state.rotateGizmo.UpdateDrag(state.rotateContext);
state.rotateGizmo.UpdateDrag(state.rotateContext, state.undoBridge);
return true;
case ActiveTransformGizmoKind::Scale:
state.scaleGizmo.UpdateDrag(state.scaleContext);
state.scaleGizmo.UpdateDrag(state.scaleContext, state.undoBridge);
return true;
case ActiveTransformGizmoKind::None:
default: