Simplify geometries to a tolerance of half a device pixel

This commit is contained in:
Tom Payne
2013-12-14 11:34:11 +01:00
parent 20e51a5e34
commit 81c0c37eb9

View File

@@ -237,8 +237,9 @@ ol.renderer.canvas.VectorLayer.prototype.renderFeature =
if (!goog.isDefAndNotNull(styles)) {
return false;
}
// simplify to a tolerance of half a CSS pixel
var squaredTolerance = resolution * resolution / 4;
// simplify to a tolerance of half a device pixel
var squaredTolerance =
resolution * resolution / (4 * pixelRatio * pixelRatio);
var i, ii, style, imageStyle, imageState;
for (i = 0, ii = styles.length; i < ii; ++i) {
style = styles[i];