| | |
| | | |
| | | seg2 = getPoint2d_cp(pa, i); |
| | | |
| | | /* This is required for robustness, see #6023 */ |
| | | if (p2d_same(seg1, pt)) |
| | | { |
| | | return LW_BOUNDARY; |
| | | } |
| | | |
| | | /* Zero length segments are ignored. */ |
| | | if (p2d_same(seg1, seg2)) |
| | | { |
| | |
| | | /* Append last point */ |
| | | kept_it++; |
| | | if (kept_it != last_it) |
| | | /*#<<<DIA_SVACE_CRITICAL*/ |
| | | memmove(pa->serialized_pointlist + pt_size * kept_it, |
| | | pa->serialized_pointlist + pt_size * last_it, |
| | | pt_size); |
| | | /*#DIA_SVACE_CRITICAL>>>*/ |
| | | pa->npoints = kept_it + 1; |
| | | } |
| | | |
| | |
| | | { |
| | | /* If there are 2 points remaining, it has to be first and last as |
| | | * we added those at the start */ |
| | | /*#<<<DIA_SVACE_CRITICAL*/ |
| | | memmove(pa->serialized_pointlist + pt_size * kept_it, |
| | | pa->serialized_pointlist + pt_size * (pa->npoints - 1), |
| | | pt_size); |
| | | /*#DIA_SVACE_CRITICAL>>>*/ |
| | | } |
| | | else if (pa->npoints != keptn) /* We don't need to move any points if we are keeping them all */ |
| | | { |