Fix division by 0: shift where I meant division

This commit is contained in:
Eric Fischer 2018-06-11 17:36:19 -07:00
parent d39e25c0e8
commit 9e089da98e

View File

@ -89,7 +89,7 @@ void split_feature(mvt_layer const &layer, mvt_feature const &feature, std::vect
static long clipid_pool = 0;
const std::vector<mvt_geometry> &geom = feature.geometry;
long extent = layer.extent;
long nextent = extent >> n;
long nextent = extent / n;
// Calculate bounding box of feature
@ -120,8 +120,8 @@ void split_feature(mvt_layer const &layer, mvt_feature const &feature, std::vect
// XXX Is this right for edges on the border?
long nclipid = 0;
if (minx / (extent >> n) != maxx / (extent >> n) ||
miny / (extent >> n) != maxy / (extent >> n)) {
if (minx / nextent != maxx / nextent ||
miny / nextent != maxy / nextent) {
nclipid = ++clipid_pool;
}