summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/scene_tree_dock.cpp13
-rw-r--r--scene/2d/line_builder.cpp4
2 files changed, 16 insertions, 1 deletions
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index a31fa9426a..6c79fad82c 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -1615,7 +1615,10 @@ void SceneTreeDock::_delete_confirm() {
}
void SceneTreeDock::_update_script_button() {
- if (EditorNode::get_singleton()->get_editor_selection()->get_selection().size() == 1) {
+ if (EditorNode::get_singleton()->get_editor_selection()->get_selection().size() == 0) {
+ button_create_script->hide();
+ button_clear_script->hide();
+ } else if (EditorNode::get_singleton()->get_editor_selection()->get_selection().size() == 1) {
Node *n = EditorNode::get_singleton()->get_editor_selection()->get_selected_node_list()[0];
if (n->get_script().is_null()) {
button_create_script->show();
@@ -1626,6 +1629,14 @@ void SceneTreeDock::_update_script_button() {
}
} else {
button_create_script->show();
+ List<Node *> selection = EditorNode::get_singleton()->get_editor_selection()->get_selected_node_list();
+ for (List<Node *>::Element *E = selection.front(); E; E = E->next()) {
+ Node *n = E->get();
+ if (!n->get_script().is_null()) {
+ button_clear_script->show();
+ return;
+ }
+ }
button_clear_script->hide();
}
}
diff --git a/scene/2d/line_builder.cpp b/scene/2d/line_builder.cpp
index 18302dcce1..eb09d3c9d3 100644
--- a/scene/2d/line_builder.cpp
+++ b/scene/2d/line_builder.cpp
@@ -279,6 +279,10 @@ void LineBuilder::build() {
}
} else {
// No intersection: fallback
+ if (current_joint_mode == Line2D::LINE_JOINT_SHARP) {
+ // There is no fallback implementation for LINE_JOINT_SHARP so switch to the LINE_JOINT_BEVEL
+ current_joint_mode = Line2D::LINE_JOINT_BEVEL;
+ }
pos_up1 = corner_pos_up;
pos_down1 = corner_pos_down;
}