fixed crash when undoing node creation + fixed highlighting

This commit is contained in:
Dmitry Stepanov
2024-01-26 20:06:01 +03:00
parent 3e3a79d1fe
commit df43c010a6
3 changed files with 22 additions and 16 deletions
+7
View File
@@ -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
+5 -3
View File
@@ -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);
}
}
}
}
+10 -13
View File
@@ -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