fixed panic when changing render path on mesh
@@ -125,14 +125,13 @@ impl MeshSection {
UiMessageData::DropdownList(DropdownListMessage::SelectionChanged(Some(
selection,
))) => {
+ if message.destination() == self.render_path {
let new_render_path = match *selection {
0 => RenderPath::Deferred,
1 => RenderPath::Forward,
_ => unreachable!(),
};
- if message.destination() == self.render_path
- && new_render_path != mesh.render_path()
- {
+ if new_render_path != mesh.render_path() {
self.sender
.send(Message::DoSceneCommand(SceneCommand::SetMeshRenderPath(
SetMeshRenderPathCommand::new(handle, new_render_path),
@@ -140,6 +139,7 @@ impl MeshSection {
.unwrap();
}
}
+ }
_ => {}
}
}
