diff --git a/src/ol/render/canvas/canvasreplay.js b/src/ol/render/canvas/canvasreplay.js index fc831dbf3a..f3572cc86e 100644 --- a/src/ol/render/canvas/canvasreplay.js +++ b/src/ol/render/canvas/canvasreplay.js @@ -344,10 +344,8 @@ ol.render.canvas.Replay.prototype.replay_ = function( context.globalAlpha = alpha * opacity; } - var w = width - originX; - var h = height - originY; - context.drawImage(image, originX, originY, w, h, x, y, - w * pixelRatio, h * pixelRatio); + context.drawImage(image, originX, originY, width, height, + x, y, width * pixelRatio, height * pixelRatio); if (opacity != 1) { context.globalAlpha = alpha; diff --git a/test_rendering/spec/ol/style/expected/icon-canvas-offset.png b/test_rendering/spec/ol/style/expected/icon-canvas-offset.png deleted file mode 100644 index 322ffda401..0000000000 Binary files a/test_rendering/spec/ol/style/expected/icon-canvas-offset.png and /dev/null differ diff --git a/test_rendering/spec/ol/style/icon.test.js b/test_rendering/spec/ol/style/icon.test.js index dc143c0896..d89bbd8a5f 100644 --- a/test_rendering/spec/ol/style/icon.test.js +++ b/test_rendering/spec/ol/style/icon.test.js @@ -30,7 +30,7 @@ describe('ol.rendering.style.Icon', function() { disposeMap(map); }); - function createFeatures(callback, offset) { + function createFeatures(callback) { var feature; feature = new ol.Feature({ geometry: new ol.geom.Point([0, 0]) @@ -44,7 +44,6 @@ describe('ol.rendering.style.Icon', function() { anchorXUnits: 'fraction', anchorYUnits: 'pixels', opacity: 0.75, - offset: offset, scale: 0.5, img: img, imgSize: [32, 48] @@ -64,14 +63,6 @@ describe('ol.rendering.style.Icon', function() { }); }); - it('tests the canvas renderer with an offset', function(done) { - map = createMap('canvas'); - createFeatures(function() { - expectResemble(map, 'spec/ol/style/expected/icon-canvas-offset.png', - IMAGE_TOLERANCE, done); - }, [10, 10]); - }); - it('tests the WebGL renderer', function(done) { assertWebGL(); map = createMap('webgl');