diff options
-rw-r--r-- | editor/plugins/skeleton_2d_editor_plugin.cpp | 5 | ||||
-rw-r--r-- | editor/plugins/sprite_editor_plugin.cpp | 5 | ||||
-rw-r--r-- | scene/2d/canvas_item.cpp | 3 |
3 files changed, 12 insertions, 1 deletions
diff --git a/editor/plugins/skeleton_2d_editor_plugin.cpp b/editor/plugins/skeleton_2d_editor_plugin.cpp index 6bf94b95eb..e372f792d6 100644 --- a/editor/plugins/skeleton_2d_editor_plugin.cpp +++ b/editor/plugins/skeleton_2d_editor_plugin.cpp @@ -20,6 +20,10 @@ void Skeleton2DEditor::edit(Skeleton2D *p_sprite) { void Skeleton2DEditor::_menu_option(int p_option) { + if (!node) { + return; + } + switch (p_option) { case MENU_OPTION_MAKE_REST: { @@ -107,6 +111,7 @@ Skeleton2DEditorPlugin::Skeleton2DEditorPlugin(EditorNode *p_node) { editor = p_node; sprite_editor = memnew(Skeleton2DEditor); editor->get_viewport()->add_child(sprite_editor); + make_visible(false); //sprite_editor->options->hide(); } diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp index 99aabcb3eb..49816fe2ae 100644 --- a/editor/plugins/sprite_editor_plugin.cpp +++ b/editor/plugins/sprite_editor_plugin.cpp @@ -80,6 +80,10 @@ Vector<Vector2> expand(const Vector<Vector2> &points, const Rect2i &rect, float void SpriteEditor::_menu_option(int p_option) { + if (!node) { + return; + } + switch (p_option) { case MENU_OPTION_CREATE_MESH_2D: { @@ -389,6 +393,7 @@ SpriteEditorPlugin::SpriteEditorPlugin(EditorNode *p_node) { editor = p_node; sprite_editor = memnew(SpriteEditor); editor->get_viewport()->add_child(sprite_editor); + make_visible(false); //sprite_editor->options->hide(); } diff --git a/scene/2d/canvas_item.cpp b/scene/2d/canvas_item.cpp index 60368816a9..a2637f816e 100644 --- a/scene/2d/canvas_item.cpp +++ b/scene/2d/canvas_item.cpp @@ -271,7 +271,8 @@ bool CanvasItem::is_visible_in_tree() const { void CanvasItem::_propagate_visibility_changed(bool p_visible) { - notification(NOTIFICATION_VISIBILITY_CHANGED); + if (!first_draw) + notification(NOTIFICATION_VISIBILITY_CHANGED); if (p_visible) update(); //todo optimize |