More potential floating point error

This commit is contained in:
Erica Fischer
2023-07-12 13:48:18 -07:00
parent 146fcae628
commit 8f2120187b
5 changed files with 8 additions and 8 deletions
+4 -4
View File
@@ -1095,12 +1095,12 @@ drawvec impose_tile_boundaries(drawvec &geom, long long extent) {
int c = clip(&x1, &y1, &x2, &y2, 0, 0, extent, extent);
if (c > 1) { // clipped
if (x1 != geom[i - 1].x || y1 != geom[i - 1].y) {
out.push_back(draw(VT_LINETO, x1, y1));
if (std::round(x1) != geom[i - 1].x || std::round(y1) != geom[i - 1].y) {
out.push_back(draw(VT_LINETO, std::round(x1), std::round(y1)));
out[out.size() - 1].necessary = 1;
}
if (x2 != geom[i - 0].x || y2 != geom[i - 0].y) {
out.push_back(draw(VT_LINETO, x2, y2));
if (std::round(x2) != geom[i - 0].x || std::round(y2) != geom[i - 0].y) {
out.push_back(draw(VT_LINETO, std::round(x2), std::round(y2)));
out[out.size() - 1].necessary = 1;
}
}