Skip to content

Commit

Permalink
The discrepancy seems to be introduced in reordering. No obvious bug
Browse files Browse the repository at this point in the history
  • Loading branch information
e-n-f committed Jul 27, 2023
1 parent 4f430bc commit e9f4cbd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion geometry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1194,13 +1194,16 @@ drawvec reorder_lines(drawvec &geom) {
for (size_t i = 0; i < geom.size(); i++) {
if (geom[i].op == VT_MOVETO) {
if (i != 0) {
// moveto is not at the start, so it is not simple
return geom;
}
} else if (geom[i].op == VT_LINETO) {
if (i == 0) {
// lineto is at the start: can't happen
return geom;
}
} else {
// something other than moveto or lineto: can't happen
return geom;
}
}
Expand All @@ -1218,7 +1221,9 @@ drawvec reorder_lines(drawvec &geom) {
out.push_back(geom[geom.size() - 1 - i]);
}
out[0].op = VT_MOVETO;
out[out.size() - 1].op = VT_LINETO;
if (out.size() > 1) {
out[out.size() - 1].op = VT_LINETO;
}
return out;
}

Expand Down
1 change: 1 addition & 0 deletions tile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -587,6 +587,7 @@ double simplify_partial(partial *p, drawvec &shared_nodes) {
}

if (t == VT_LINE && additional[A_REVERSE]) {
geom = remove_noop(geom, t, 0);
geom = reorder_lines(geom);
}

Expand Down

0 comments on commit e9f4cbd

Please sign in to comment.