From df43c010a6eb4bf2ebd6180ac49e02de92b5dd72 Mon Sep 17 00:00:00 2001 From: Dmitry Stepanov Date: Fri, 26 Jan 2024 20:06:01 +0300 Subject: [PATCH 1/2] fixed crash when undoing node creation + fixed highlighting --- CHANGELOG.md | 7 +++++++ editor/src/highlight.rs | 8 +++++--- editor/src/scene/mod.rs | 23 ++++++++++------------- 3 files changed, 22 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b411c2f4..e7c369953 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,13 @@ - TODO +# 0.33.1 + +## Fixed + +- Fixed occasional crash when undoing node creation +- Fixed highlighting for objects that were cloned + # 0.33 ## Added diff --git a/editor/src/highlight.rs b/editor/src/highlight.rs index 060c72159..b76da8fb0 100644 --- a/editor/src/highlight.rs +++ b/editor/src/highlight.rs @@ -205,9 +205,11 @@ impl SceneRenderPass for HighlightRenderPass { }; for &root_node_handle in self.nodes_to_highlight.iter() { - for node_handle in ctx.scene.graph.traverse_handle_iter(root_node_handle) { - if let Some(node) = ctx.scene.graph.try_get(node_handle) { - node.collect_render_data(&mut render_context); + if ctx.scene.graph.is_valid_handle(root_node_handle) { + for node_handle in ctx.scene.graph.traverse_handle_iter(root_node_handle) { + if let Some(node) = ctx.scene.graph.try_get(node_handle) { + node.collect_render_data(&mut render_context); + } } } } diff --git a/editor/src/scene/mod.rs b/editor/src/scene/mod.rs index 9815a5c18..2fe94f027 100644 --- a/editor/src/scene/mod.rs +++ b/editor/src/scene/mod.rs @@ -830,6 +830,16 @@ impl SceneController for GameScene { self.camera_controller .update(&mut scene.graph, settings, path, dt); + let mut highlighter = self.highlighter.borrow_mut(); + highlighter.nodes_to_highlight.clear(); + + highlighter.scene_handle = self.scene; + if let Selection::Graph(ref selection) = editor_selection { + for &handle in selection.nodes() { + highlighter.nodes_to_highlight.insert(handle); + } + } + new_render_target } @@ -881,19 +891,6 @@ impl SceneController for GameScene { )); false } - Message::SelectionChanged { .. } => { - let mut highlighter = self.highlighter.borrow_mut(); - highlighter.nodes_to_highlight.clear(); - - highlighter.scene_handle = self.scene; - if let Selection::Graph(ref selection) = selection { - for &handle in selection.nodes() { - highlighter.nodes_to_highlight.insert(handle); - } - } - - false - } Message::ProvideSceneHierarchy { view } => { let scene = &engine.scenes[self.scene]; engine From 468bbd5aca4262d26d629bd528460843d99be879 Mon Sep 17 00:00:00 2001 From: Dmitry Stepanov Date: Fri, 26 Jan 2024 20:08:06 +0300 Subject: [PATCH 2/2] bump editor version + updated changelog --- CHANGELOG.md | 6 +++--- editor/Cargo.toml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7c369953..1262bca51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.34 (WIP) +# 0.34 Engine + 0.21.0 Editor (WIP) ## Added @@ -16,14 +16,14 @@ - TODO -# 0.33.1 +# 0.33 Engine + 0.20.1 Editor ## Fixed - Fixed occasional crash when undoing node creation - Fixed highlighting for objects that were cloned -# 0.33 +# 0.33 Engine + 0.20 Editor ## Added diff --git a/editor/Cargo.toml b/editor/Cargo.toml index 60fcc6526..941d95a72 100644 --- a/editor/Cargo.toml +++ b/editor/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "fyroxed_base" license = "MIT" -version = "0.20.0" +version = "0.20.1" authors = ["Dmitry Stepanov "] edition = "2021" rust-version = "1.72"