Make sure drawImage works in Safari with an offset

This commit is contained in:
Bart van den Eijnden
2015-10-29 10:59:21 +01:00
parent c5dac0aa70
commit 085a6c8135
3 changed files with 14 additions and 3 deletions

View File

@@ -343,8 +343,10 @@ ol.render.canvas.Replay.prototype.replay_ = function(
context.globalAlpha = alpha * opacity;
}
context.drawImage(image, originX, originY, width, height,
x, y, width * pixelRatio, height * pixelRatio);
var w = width - originX;
var h = height - originY;
context.drawImage(image, originX, originY, w, h, x, y,
w * pixelRatio, h * pixelRatio);
if (opacity != 1) {
context.globalAlpha = alpha;