summaryrefslogtreecommitdiff
path: root/editor
diff options
context:
space:
mode:
authorJuan Linietsky <reduzio@gmail.com>2017-08-18 15:11:16 -0300
committerJuan Linietsky <reduzio@gmail.com>2017-08-18 15:12:48 -0300
commit72be8876ea40984532d283c598dfcc267d30c829 (patch)
tree50ec987395edb1976e2e0437861d18e7ee7c7ba2 /editor
parent3b553377c77c59885a3561f71327e7ca5f0ec9e4 (diff)
Properly manage drawing of primitives when they lack an area, fixes #8930
Diffstat (limited to 'editor')
-rw-r--r--editor/plugins/path_editor_plugin.cpp18
-rw-r--r--editor/scene_tree_dock.cpp2
2 files changed, 15 insertions, 5 deletions
diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp
index c32ed1064f..96a98f3c48 100644
--- a/editor/plugins/path_editor_plugin.cpp
+++ b/editor/plugins/path_editor_plugin.cpp
@@ -222,8 +222,10 @@ void PathSpatialGizmo::redraw() {
//v3p.push_back(r[i]+Vector3(0,0.2,0));
}
- add_lines(v3p, PathEditorPlugin::singleton->path_material);
- add_collision_segments(v3p);
+ if (v3p.size() > 1) {
+ add_lines(v3p, PathEditorPlugin::singleton->path_material);
+ add_collision_segments(v3p);
+ }
if (PathEditorPlugin::singleton->get_edited_path() == path) {
v3p.clear();
@@ -247,9 +249,15 @@ void PathSpatialGizmo::redraw() {
}
}
- add_lines(v3p, PathEditorPlugin::singleton->path_thin_material);
- add_handles(handles);
- add_handles(sec_handles, false, true);
+ if (v3p.size() > 1) {
+ add_lines(v3p, PathEditorPlugin::singleton->path_thin_material);
+ }
+ if (handles.size()) {
+ add_handles(handles);
+ }
+ if (sec_handles.size()) {
+ add_handles(sec_handles, false, true);
+ }
}
}
diff --git a/editor/scene_tree_dock.cpp b/editor/scene_tree_dock.cpp
index ce3b85332f..e984098bd4 100644
--- a/editor/scene_tree_dock.cpp
+++ b/editor/scene_tree_dock.cpp
@@ -2030,6 +2030,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
tb->set_tooltip(TTR("Attach a new or existing script for the selected node."));
tb->set_shortcut(ED_GET_SHORTCUT("scene_tree/attach_script"));
filter_hbc->add_child(tb);
+ tb->hide();
button_create_script = tb;
tb = memnew(ToolButton);
@@ -2038,6 +2039,7 @@ SceneTreeDock::SceneTreeDock(EditorNode *p_editor, Node *p_scene_root, EditorSel
tb->set_shortcut(ED_GET_SHORTCUT("scene_tree/clear_script"));
filter_hbc->add_child(tb);
button_clear_script = tb;
+ tb->hide();
scene_tree = memnew(SceneTreeEditor(false, true, true));
vbc->add_child(scene_tree);