Use integers when positioning on the target canvas

This avoids blurred images after view center changes (dx, dy)
and at fractional zoom levels (dw, dh).
This commit is contained in:
ahocevar
2013-10-16 16:39:45 +02:00
parent 5fe7c20450
commit 386fac2429

View File

@@ -143,7 +143,7 @@ ol.renderer.canvas.Map.prototype.renderFrame = function(frameState) {
var dw = image.width * goog.vec.Mat4.getElement(transform, 0, 0);
var dh = image.height * goog.vec.Mat4.getElement(transform, 1, 1);
context.drawImage(image, 0, 0, image.width, image.height,
dx, dy, dw, dh);
Math.round(dx), Math.round(dy), Math.round(dw), Math.round(dh));
} else {
context.setTransform(
goog.vec.Mat4.getElement(transform, 0, 0),