You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-12-04 17:04:49 +00:00
Fix Curve Editor crash with null curve
This commit is contained in:
@@ -978,9 +978,11 @@ void CurveEditor::_notification(int p_what) {
|
|||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_READY: {
|
case NOTIFICATION_READY: {
|
||||||
Ref<Curve> curve = curve_editor_rect->get_curve();
|
Ref<Curve> curve = curve_editor_rect->get_curve();
|
||||||
// Set snapping settings based on the curve's meta.
|
if (curve.is_valid()) {
|
||||||
snap_button->set_pressed(curve->get_meta("_snap_enabled", false));
|
// Set snapping settings based on the curve's meta.
|
||||||
snap_count_edit->set_value(curve->get_meta("_snap_count", DEFAULT_SNAP));
|
snap_button->set_pressed(curve->get_meta("_snap_enabled", false));
|
||||||
|
snap_count_edit->set_value(curve->get_meta("_snap_count", DEFAULT_SNAP));
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -265,9 +265,11 @@ void GradientTexture2DEditor::_notification(int p_what) {
|
|||||||
snap_button->set_icon(get_theme_icon(SNAME("SnapGrid"), SNAME("EditorIcons")));
|
snap_button->set_icon(get_theme_icon(SNAME("SnapGrid"), SNAME("EditorIcons")));
|
||||||
} break;
|
} break;
|
||||||
case NOTIFICATION_READY: {
|
case NOTIFICATION_READY: {
|
||||||
// Set snapping settings based on the texture's meta.
|
if (texture.is_valid()) {
|
||||||
snap_button->set_pressed(texture->get_meta("_snap_enabled", false));
|
// Set snapping settings based on the texture's meta.
|
||||||
snap_count_edit->set_value(texture->get_meta("_snap_count", DEFAULT_SNAP));
|
snap_button->set_pressed(texture->get_meta("_snap_enabled", false));
|
||||||
|
snap_count_edit->set_value(texture->get_meta("_snap_count", DEFAULT_SNAP));
|
||||||
|
}
|
||||||
} break;
|
} break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user