Fixed bug in evaluating catmull-rom curves with straight segments at 0 or 1

Fixes #5072
This commit is contained in:
Alberto Griggio 2018-12-10 17:26:22 +01:00
parent fd48b34cd5
commit 7a918fa373

View File

@ -326,6 +326,9 @@ inline void catmull_rom_spline(int n_points,
if (p1_y == p2_y && (p1_y == 0 || p1_y == 1)) {
for (i = 1; i < n_points-1; ++i) {
t = p1_x + space * i;
if (t >= p2_x) {
break;
}
res_x.push_back(t);
res_y.push_back(p1_y);
}