Files
MapLibreParticleLab/src/mbgl/util/get_geometries.cpp
Thiago Marcos P. Santos f52b6105db [core] round() not always on std:: namespace
Build fix.
2016-02-10 19:38:32 +02:00

22 lines
565 B
C++

#include <mbgl/util/get_geometries.hpp>
#include <mbgl/util/constants.hpp>
#include <cmath>
namespace mbgl {
GeometryCollection getGeometries(const GeometryTileFeature& feature) {
const float scale = float(util::EXTENT) / feature.getExtent();
GeometryCollection geometryCollection = feature.getGeometries();
for (auto& line : geometryCollection) {
for (auto& point : line) {
point.x = ::round(point.x * scale);
point.y = ::round(point.y * scale);
}
}
return geometryCollection;
}
} // namespace mbgl