Преглед на файлове

Path2D: Check points count before rendering.

(cherry picked from commit b770a4d0ace3aea4cca3f8926deef82205418fd0)
Anilforextra преди 3 години
родител
ревизия
3fad43acad
променени са 1 файла, в които са добавени 4 реда и са изтрити 0 реда
  1. 4 0
      scene/2d/path_2d.cpp

+ 4 - 0
scene/2d/path_2d.cpp

@@ -94,6 +94,10 @@ void Path2D::_notification(int p_what) {
 			return;
 		}
 
+		if (curve->get_point_count() < 2) {
+			return;
+		}
+
 #ifdef TOOLS_ENABLED
 		const float line_width = 2 * EDSCALE;
 #else