fix(bedit): restore the view when leaving the block editor

Entering the block editor reframes the camera on the block's own
geometry, but nothing remembered where the model view was — Save /
Discard returned to the layout with the camera still parked at the
editor's framing (#425). The session now captures the camera on entry
and both exits restore it exactly.

Co-Authored-By: Claude Fable 5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Fable 5 committed 2026-07-21 11:06:42 +03:00
1 parent 84620852fe
commit f03288f120
2 files changed
+14 -1

No files matched your search

+4 -1
View File
@@ -43,7 +43,7 @@ pub fn block_edit_tools() -> Vec<ToolDef> {
// ── Session state (held in DocumentTab) ───────────────────────────────────
/// Active BEDIT block-editor session. Lives in `DocumentTab::block_edit`.
#[derive(Debug, Clone)]
#[derive(Clone)]
pub struct BlockEditSession {
/// Name of the block being edited (also the space-tab label).
pub block_name: String,
@@ -55,6 +55,9 @@ pub struct BlockEditSession {
/// The block's block-local entities captured on entry, so Discard can
/// restore the definition (structural Block/BlockEnd/AttDef excluded).
pub snapshot: Vec<EntityType>,
/// Camera state of the space that was active when BEDIT began, restored
/// on Save/Discard so the view returns exactly where it was (#425).
pub return_camera: crate::scene::view::camera::Camera,
}
// ── BEDIT pick command ─────────────────────────────────────────────────────