Prevent errors when Line2D has 0 length

This commit is contained in:
kobewi
2025-02-12 17:43:53 +01:00
parent f418603522
commit 842421ea61
2 changed files with 8 additions and 0 deletions

View File

@@ -112,6 +112,11 @@ void LineBuilder::build() {
}
}
if (Math::is_zero_approx(total_distance)) {
// Zero-length line, nothing to build.
return;
}
if (_interpolate_color) {
color0 = gradient->get_color(0);
} else {