diff --git a/src/ol/render/canvas/Replay.js b/src/ol/render/canvas/Replay.js index 9a3c595aae..cd4264e15c 100644 --- a/src/ol/render/canvas/Replay.js +++ b/src/ol/render/canvas/Replay.js @@ -268,7 +268,10 @@ _ol_render_canvas_Replay_.prototype.replayImage_ = function(context, x, y, image createOrUpdate(boxX, boxY, boxX + boxW, boxY + boxH, box); } var canvas = context.canvas; - var intersects = box[0] <= canvas.width && box[2] >= 0 && box[1] <= canvas.height && box[3] >= 0; + var strokePadding = strokeInstruction ? (strokeInstruction[2] * scale / 2) : 0; + var intersects = + box[0] - strokePadding <= canvas.width && box[2] + strokePadding >= 0 && + box[1] - strokePadding <= canvas.height && box[3] + strokePadding >= 0; if (snapToPixel) { x = Math.round(x);