浏览代码

Merge pull request #102870 from timoschwarzer/fix/line-2d-not-rendering

Fix Line2D not rendering anything when total length is not computed
Rémi Verschelde 7 月之前
父节点
当前提交
96cdbbe5bd
共有 1 个文件被更改,包括 1 次插入1 次删除
  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.
 		return;
 	}