Make sure icons show up in Safari
Make sure that drawImage calls don't exceed source image dimensions.
This commit is contained in:
@@ -349,8 +349,11 @@ 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 > image.width) ? image.width - originX : width;
|
||||
var h = (height + originY > image.height) ? image.height - originY : height;
|
||||
|
||||
context.drawImage(image, originX, originY, w, h,
|
||||
x, y, w * pixelRatio, h * pixelRatio);
|
||||
|
||||
if (opacity != 1) {
|
||||
context.globalAlpha = alpha;
|
||||
|
||||
Reference in New Issue
Block a user