Use full precision for the declutter box

This commit is contained in:
Andreas Hocevar
2017-12-11 09:36:28 +01:00
parent 406a02e786
commit a2d41da30f
2 changed files with 20 additions and 18 deletions

View File

@@ -226,10 +226,6 @@ ol.render.canvas.Replay.prototype.replayImage_ = function(context, x, y, image,
anchorY *= scale;
x -= anchorX;
y -= anchorY;
if (snapToPixel) {
x = Math.round(x);
y = Math.round(y);
}
var w = (width + originX > image.width) ? image.width - originX : width;
var h = (height + originY > image.height) ? image.height - originY : height;
@@ -271,6 +267,12 @@ ol.render.canvas.Replay.prototype.replayImage_ = function(context, x, y, image,
}
var canvas = context.canvas;
var intersects = box[0] <= canvas.width && box[2] >= 0 && box[1] <= canvas.height && box[3] >= 0;
if (snapToPixel) {
x = Math.round(x);
y = Math.round(y);
}
if (declutterGroup) {
if (!intersects && declutterGroup[4] == 1) {
return;