Fix vertical stroke/fill alignment for text along lines

This commit is contained in:
Andreas Hocevar
2017-09-24 21:23:41 +02:00
parent 73b3213a96
commit ca11fd00c1
11 changed files with 19 additions and 12 deletions

View File

@@ -383,7 +383,6 @@ ol.render.canvas.TextReplay.prototype.drawChars_ = function(begin, end) {
var stroke = !!strokeState;
var textState = this.textState_;
var baseline = ol.render.replay.TEXT_ALIGN[textState.textBaseline];
var strokeWidth = stroke && strokeState.lineWidth ? strokeState.lineWidth * pixelRatio : 0;
var labels = [];
var text = this.text_;
@@ -409,13 +408,13 @@ ol.render.canvas.TextReplay.prototype.drawChars_ = function(begin, end) {
begin, end, labels, baseline,
textState.exceedLength, textState.maxAngle,
ol.render.canvas.TextReplay.getTextWidth.bind(widths, context, pixelRatio),
offsetY, strokeWidth, this.text_, align, this.textScale_
offsetY, this.text_, align, this.textScale_
]);
this.hitDetectionInstructions.push([ol.render.canvas.Instruction.DRAW_CHARS,
begin, end, labels, baseline,
textState.exceedLength, textState.maxAngle,
ol.render.canvas.TextReplay.getTextWidth.bind(widths, context, 1),
offsetY, strokeWidth, this.text_, align, this.textScale_ / pixelRatio
offsetY, this.text_, align, this.textScale_ / pixelRatio
]);
};