mirror of
https://github.com/mapbox/tippecanoe.git
synced 2025-03-25 13:17:38 +00:00
Merge pull request #328 from mapbox/grid-snap-rounding
Round coordinates in low-zoom grid instead of truncating
This commit is contained in:
commit
afa782fb7f
@ -1,3 +1,7 @@
|
||||
## 1.15.3
|
||||
|
||||
* Round coordinates in low-zoom grid math instead of truncating
|
||||
|
||||
## 1.15.2
|
||||
|
||||
* Add --grid-low-zooms option to snap low-zoom features to the tile grid
|
||||
|
@ -1302,10 +1302,11 @@ static int clip(double *x0, double *y0, double *x1, double *y1, double xmin, dou
|
||||
|
||||
drawvec stairstep(drawvec &geom, int z, int detail) {
|
||||
drawvec out;
|
||||
double scale = 1 << (32 - detail - z);
|
||||
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
geom[i].x >>= (32 - detail - z);
|
||||
geom[i].y >>= (32 - detail - z);
|
||||
geom[i].x = std::round(geom[i].x / scale);
|
||||
geom[i].y = std::round(geom[i].y / scale);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i < geom.size(); i++) {
|
||||
|
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
#define VERSION "tippecanoe v1.15.2\n"
|
||||
#define VERSION "tippecanoe v1.15.3\n"
|
||||
|
Loading…
x
Reference in New Issue
Block a user