Scale the image size and anchor by pixelRatio

This commit is contained in:
Frederic Junod
2014-01-06 11:11:07 +01:00
parent 47056f6012
commit 3f751a5903

View File

@@ -663,20 +663,19 @@ ol.render.canvas.ImageReplay.prototype.setImageStyle = function(imageStyle) {
goog.asserts.assert(!goog.isNull(anchor)); goog.asserts.assert(!goog.isNull(anchor));
var size = imageStyle.getSize(); var size = imageStyle.getSize();
goog.asserts.assert(!goog.isNull(size)); goog.asserts.assert(!goog.isNull(size));
// FIXME pixel ratio
var hitDetectionImage = imageStyle.getHitDetectionImage(1); var hitDetectionImage = imageStyle.getHitDetectionImage(1);
goog.asserts.assert(!goog.isNull(hitDetectionImage)); goog.asserts.assert(!goog.isNull(hitDetectionImage));
var image = imageStyle.getImage(1); var image = imageStyle.getImage(1);
goog.asserts.assert(!goog.isNull(image)); goog.asserts.assert(!goog.isNull(image));
this.anchorX_ = anchor[0]; this.anchorX_ = anchor[0] * this.pixelRatio;
this.anchorY_ = anchor[1]; this.anchorY_ = anchor[1] * this.pixelRatio;
this.hitDetectionImage_ = hitDetectionImage; this.hitDetectionImage_ = hitDetectionImage;
this.image_ = image; this.image_ = image;
this.height_ = size[1]; this.height_ = size[1] * this.pixelRatio;
this.rotation_ = imageStyle.getRotation(); this.rotation_ = imageStyle.getRotation();
this.scale_ = imageStyle.getScale(); this.scale_ = imageStyle.getScale();
this.snapToPixel_ = imageStyle.getSnapToPixel(); this.snapToPixel_ = imageStyle.getSnapToPixel();
this.width_ = size[0]; this.width_ = size[0] * this.pixelRatio;
}; };