Fix ghost SpriteFramesEditor cause crash
This commit is contained in:
parent
0b1d516f67
commit
0069131546
1 changed files with 14 additions and 17 deletions
|
@ -1171,13 +1171,13 @@ void SpriteFramesEditor::edit(Ref<SpriteFrames> p_frames) {
|
||||||
|
|
||||||
if (!p_frames.is_valid()) {
|
if (!p_frames.is_valid()) {
|
||||||
frames.unref();
|
frames.unref();
|
||||||
|
hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
frames = p_frames;
|
frames = p_frames;
|
||||||
read_only = EditorNode::get_singleton()->is_resource_read_only(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)) {
|
if (!p_frames->has_animation(edited_anim)) {
|
||||||
List<StringName> anim_names;
|
List<StringName> anim_names;
|
||||||
frames->get_animation_list(&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
|
// Clear zoom and split sheet texture
|
||||||
split_sheet_preview->set_texture(Ref<Texture2D>());
|
split_sheet_preview->set_texture(Ref<Texture2D>());
|
||||||
_zoom_reset();
|
_zoom_reset();
|
||||||
} else {
|
|
||||||
hide();
|
|
||||||
}
|
|
||||||
|
|
||||||
add_anim->set_disabled(read_only);
|
add_anim->set_disabled(read_only);
|
||||||
delete_anim->set_disabled(read_only);
|
delete_anim->set_disabled(read_only);
|
||||||
|
|
Loading…
Reference in a new issue