mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-01-22 04:18:01 +00:00
Fix overflow that was leaving some lines too far away
This commit is contained in:
parent
41fcd4c82f
commit
ed05bc9f7e
4
tile.cc
4
tile.cc
@ -305,7 +305,7 @@ void douglas_peucker(struct draw *geom, int n, double e) {
|
||||
int first = recursion_stack.top();
|
||||
recursion_stack.pop();
|
||||
|
||||
int max_distance = -1;
|
||||
double max_distance = -1;
|
||||
int farthest_element_index = second;
|
||||
|
||||
// find index idx of element with max_distance
|
||||
@ -316,7 +316,7 @@ void douglas_peucker(struct draw *geom, int n, double e) {
|
||||
geom[second].x, geom[second].y);
|
||||
|
||||
double distance = fabs(temp_dist);
|
||||
|
||||
|
||||
if (distance > e && distance > max_distance) {
|
||||
farthest_element_index = i;
|
||||
max_distance = distance;
|
||||
|
Loading…
Reference in New Issue
Block a user