From 72be8876ea40984532d283c598dfcc267d30c829 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Fri, 18 Aug 2017 15:11:16 -0300 Subject: Properly manage drawing of primitives when they lack an area, fixes #8930 --- editor/plugins/path_editor_plugin.cpp | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'editor/plugins/path_editor_plugin.cpp') diff --git a/editor/plugins/path_editor_plugin.cpp b/editor/plugins/path_editor_plugin.cpp index c32ed1064..96a98f3c4 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); + } } } -- cgit v1.2.3-70-g09d2