You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
OpenXR: fix casts and loop in action map editor
This commit replaces potentially unsafe static casts with Object::cast_to and fixes the order in which UI elements are looped over when removing controls. This fixes crashes and wrong data being displayed in the OpenXR action map editor when saving or resetting action maps.
This commit is contained in:
@@ -308,7 +308,7 @@ void OpenXRInteractionProfileEditor::_update_interaction_profile() {
|
||||
|
||||
void OpenXRInteractionProfileEditor::_theme_changed() {
|
||||
for (int i = 0; i < main_hb->get_child_count(); i++) {
|
||||
Control *panel = static_cast<Control *>(main_hb->get_child(i));
|
||||
Control *panel = Object::cast_to<Control>(main_hb->get_child(i));
|
||||
if (panel) {
|
||||
panel->add_theme_style_override("panel", get_theme_stylebox(SNAME("panel"), SNAME("TabContainer")));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user