Browse Source

Fix Line2D not rendering anything when total length is not computed

Timo Schwarzer 6 months ago
parent
commit
ebef20f556
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scene/2d/line_builder.cpp

+ 1 - 1
scene/2d/line_builder.cpp

@@ -112,7 +112,7 @@ void LineBuilder::build() {
 		}
 		}
 	}
 	}
 
 
-	if (Math::is_zero_approx(total_distance)) {
+	if (point_count < 2 || (distance_required && Math::is_zero_approx(total_distance))) {
 		// Zero-length line, nothing to build.
 		// Zero-length line, nothing to build.
 		return;
 		return;
 	}
 	}