diff --git a/src/ol/render/canvas/canvasimmediate.js b/src/ol/render/canvas/canvasimmediate.js index 56db54df72..2cd6dd2570 100644 --- a/src/ol/render/canvas/canvasimmediate.js +++ b/src/ol/render/canvas/canvasimmediate.js @@ -946,8 +946,8 @@ ol.render.canvas.Immediate.prototype.setTextStyle = function(textStyle) { textStrokeStyleLineDash : ol.render.canvas.defaultLineDash, lineJoin: goog.isDef(textStrokeStyleLineJoin) ? textStrokeStyleLineJoin : ol.render.canvas.defaultLineJoin, - lineWidth: this.pixelRatio_ * (goog.isDef(textStrokeStyleWidth) ? - textStrokeStyleWidth : ol.render.canvas.defaultLineWidth), + lineWidth: goog.isDef(textStrokeStyleWidth) ? + textStrokeStyleWidth : ol.render.canvas.defaultLineWidth, miterLimit: goog.isDef(textStrokeStyleMiterLimit) ? textStrokeStyleMiterLimit : ol.render.canvas.defaultMiterLimit, strokeStyle: ol.color.asString(!goog.isNull(textStrokeStyleColor) ? diff --git a/src/ol/render/canvas/canvasreplay.js b/src/ol/render/canvas/canvasreplay.js index 6a40bfc0c2..ae2d385f93 100644 --- a/src/ol/render/canvas/canvasreplay.js +++ b/src/ol/render/canvas/canvasreplay.js @@ -416,8 +416,10 @@ ol.render.canvas.Replay.prototype.replay_ = function( goog.asserts.assert(goog.isString(instruction[4])); goog.asserts.assert(goog.isNumber(instruction[5])); goog.asserts.assert(!goog.isNull(instruction[6])); + var usePixelRatio = goog.isDef(instruction[7]) ? instruction[7] : true; + var lineWidth = /** @type {number} */ (instruction[2]); context.strokeStyle = /** @type {string} */ (instruction[1]); - context.lineWidth = /** @type {number} */ (instruction[2]) * pixelRatio; + context.lineWidth = usePixelRatio ? lineWidth * pixelRatio : lineWidth; context.lineCap = /** @type {string} */ (instruction[3]); context.lineJoin = /** @type {string} */ (instruction[4]); context.miterLimit = /** @type {number} */ (instruction[5]); @@ -1647,7 +1649,7 @@ ol.render.canvas.TextReplay.prototype.setReplayStrokeState_ = var setStrokeStyleInstruction = [ ol.render.canvas.Instruction.SET_STROKE_STYLE, strokeState.strokeStyle, strokeState.lineWidth, strokeState.lineCap, strokeState.lineJoin, - strokeState.miterLimit, strokeState.lineDash + strokeState.miterLimit, strokeState.lineDash, false ]; this.instructions.push(setStrokeStyleInstruction); this.hitDetectionInstructions.push(setStrokeStyleInstruction);