Scale the text offset by the device's pixel ratio

Fixes #1918
This commit is contained in:
Frederic Junod
2014-03-28 12:22:10 +01:00
parent baab8dab63
commit e0278e0e9c
2 changed files with 6 additions and 4 deletions

View File

@@ -960,8 +960,10 @@ ol.render.canvas.Immediate.prototype.setTextStyle = function(textStyle) {
textTextBaseline : ol.render.canvas.defaultTextBaseline
};
this.text_ = goog.isDef(textText) ? textText : '';
this.textOffsetX_ = goog.isDef(textOffsetX) ? textOffsetX : 0;
this.textOffsetY_ = goog.isDef(textOffsetY) ? textOffsetY : 0;
this.textOffsetX_ =
goog.isDef(textOffsetX) ? (this.pixelRatio_ * textOffsetX) : 0;
this.textOffsetY_ =
goog.isDef(textOffsetY) ? (this.pixelRatio_ * textOffsetY) : 0;
this.textRotation_ = goog.isDef(textRotation) ? textRotation : 0;
this.textScale_ = this.pixelRatio_ * (goog.isDef(textScale) ?
textScale : 1);