1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-12 13:20:55 +00:00

Fix ghost SpriteFramesEditor cause crash

This commit is contained in:
Silc Renew
2023-02-06 14:08:12 +09:00
parent 0b1d516f67
commit 0069131546

View File

@@ -1171,13 +1171,13 @@ void SpriteFramesEditor::edit(Ref<SpriteFrames> p_frames) {
if (!p_frames.is_valid()) {
frames.unref();
hide();
return;
}
frames = p_frames;
read_only = EditorNode::get_singleton()->is_resource_read_only(p_frames);
if (p_frames.is_valid()) {
if (!p_frames->has_animation(edited_anim)) {
List<StringName> anim_names;
frames->get_animation_list(&anim_names);
@@ -1193,9 +1193,6 @@ void SpriteFramesEditor::edit(Ref<SpriteFrames> p_frames) {
// Clear zoom and split sheet texture
split_sheet_preview->set_texture(Ref<Texture2D>());
_zoom_reset();
} else {
hide();
}
add_anim->set_disabled(read_only);
delete_anim->set_disabled(read_only);