diff options
| author | Rémi Verschelde | 2018-01-04 15:02:47 +0100 |
|---|---|---|
| committer | GitHub | 2018-01-04 15:02:47 +0100 |
| commit | 99eb394a5f5f164a562e315980cb730a704a0a1c (patch) | |
| tree | f044db5714626c7c91fda34022bd4af6f444c7b2 /editor/editor_data.cpp | |
| parent | 913777b773c59f4c79c04d43c8a5644f35ff35c3 (diff) | |
| parent | 59564f267ce4379282911007ef78ec8738f358e8 (diff) | |
| download | godot-99eb394a5f5f164a562e315980cb730a704a0a1c.tar.gz godot-99eb394a5f5f164a562e315980cb730a704a0a1c.tar.zst godot-99eb394a5f5f164a562e315980cb730a704a0a1c.zip | |
Diffstat (limited to 'editor/editor_data.cpp')
| -rw-r--r-- | editor/editor_data.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/editor/editor_data.cpp b/editor/editor_data.cpp index 4acee1363..c12a112fa 100644 --- a/editor/editor_data.cpp +++ b/editor/editor_data.cpp @@ -880,6 +880,7 @@ void EditorSelection::_bind_methods() { ClassDB::bind_method(D_METHOD("remove_node", "node"), &EditorSelection::remove_node); ClassDB::bind_method(D_METHOD("get_selected_nodes"), &EditorSelection::_get_selected_nodes); ClassDB::bind_method(D_METHOD("get_transformable_selected_nodes"), &EditorSelection::_get_transformable_selected_nodes); + ClassDB::bind_method(D_METHOD("_emit_change"), &EditorSelection::_emit_change); ADD_SIGNAL(MethodInfo("selection_changed")); } @@ -923,7 +924,15 @@ void EditorSelection::update() { if (!changed) return; changed = false; + if (!emitted) { + emitted = true; + call_deferred("_emit_change"); + } +} + +void EditorSelection::_emit_change() { emit_signal("selection_changed"); + emitted = false; } List<Node *> &EditorSelection::get_selected_node_list() { @@ -947,6 +956,7 @@ void EditorSelection::clear() { } EditorSelection::EditorSelection() { + emitted = false; changed = false; nl_changed = false; } |
