mirror of
https://github.com/godotengine/godot.git
synced 2026-01-06 10:11:57 +03:00
Prevent errors when Line2D has 0 length
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user