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

Avoid double editing when clicking AnimatedSprite

This commit is contained in:
kobewi
2024-04-17 19:51:42 +02:00
parent 4b7776e31b
commit e36301e418
2 changed files with 7 additions and 2 deletions

View File

@@ -1476,6 +1476,10 @@ void SpriteFramesEditor::edit(Ref<SpriteFrames> p_frames) {
_fetch_sprite_node(); // Fetch node after set frames.
}
bool SpriteFramesEditor::is_editing() const {
return frames.is_valid();
}
Variant SpriteFramesEditor::get_drag_data_fw(const Point2 &p_point, Control *p_from) {
if (read_only) {
return false;
@@ -2325,7 +2329,7 @@ bool SpriteFramesEditorPlugin::handles(Object *p_object) const {
if (animated_sprite_3d && *animated_sprite_3d->get_sprite_frames()) {
return true;
}
return p_object->is_class("SpriteFrames");
return !frames_editor->is_editing() && Object::cast_to<SpriteFrames>(p_object);
}
void SpriteFramesEditorPlugin::make_visible(bool p_visible) {