bugfix for Invalid speed "G1 F-2147483648" (#10944)
Some checks are pending
Build all / Build All (push) Waiting to run
Build all / Flatpak (push) Waiting to run

added non zero safety check for feedrate calculation
This commit is contained in:
Azi 2025-10-12 07:03:38 -07:00 committed by GitHub
parent abe3cd48f9
commit 6feb99bd2d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -153,7 +153,8 @@ struct PerExtruderAdjustments
assert(line.time_max >= 0.f && line.time_max < FLT_MAX);
line.slowdown = true;
line.time = line.time_max;
line.feedrate = line.length / line.time;
if (line.time > 0.f)
line.feedrate = line.length / line.time;
}
time_total += line.time;
}
@ -169,7 +170,8 @@ struct PerExtruderAdjustments
if (line.adjustable(slowdown_external_perimeters)) {
line.slowdown = true;
line.time = std::min(line.time_max, line.time * factor);
line.feedrate = line.length / line.time;
if (line.time > 0.f)
line.feedrate = line.length / line.time;
}
time_total += line.time;
}