Merge pull request #1488 from fredj/vector-api-image-pixelRatio

[vector-api] Scale the image size and anchor by pixelRatio
This commit is contained in:
Frédéric Junod
2014-01-08 07:37:42 -08:00
+4 -5
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;
}; };