Avoid defining default values at multiple locations

This commit is contained in:
Éric Lemoine
2014-05-07 09:52:10 +02:00
parent 6cd403945a
commit 511e3f7810

View File

@@ -886,11 +886,7 @@ ol.render.canvas.Immediate.prototype.setImageStyle = function(imageStyle) {
var imageAnchor = imageStyle.getAnchor();
// FIXME pixel ratio
var imageImage = imageStyle.getImage(1);
var imageOpacity = imageStyle.getOpacity();
var imageOrigin = imageStyle.getOrigin();
var imageRotateWithView = imageStyle.getRotateWithView();
var imageRotation = imageStyle.getRotation();
var imageScale = imageStyle.getScale();
var imageSize = imageStyle.getSize();
goog.asserts.assert(!goog.isNull(imageAnchor));
goog.asserts.assert(!goog.isNull(imageImage));
@@ -900,13 +896,12 @@ ol.render.canvas.Immediate.prototype.setImageStyle = function(imageStyle) {
this.imageAnchorY_ = imageAnchor[1];
this.imageHeight_ = imageSize[1];
this.image_ = imageImage;
this.imageOpacity_ = goog.isDef(imageOpacity) ? imageOpacity : 1;
this.imageOpacity_ = imageStyle.getOpacity();
this.imageOriginX_ = imageOrigin[0];
this.imageOriginY_ = imageOrigin[1];
this.imageRotateWithView_ = goog.isDef(imageRotateWithView) ?
imageRotateWithView : false;
this.imageRotation_ = goog.isDef(imageRotation) ? imageRotation : 0;
this.imageScale_ = goog.isDef(imageScale) ? imageScale : 1;
this.imageRotateWithView_ = imageStyle.getRotateWithView();
this.imageRotation_ = imageStyle.getRotation();
this.imageScale_ = imageStyle.getScale();
this.imageSnapToPixel_ = imageStyle.getSnapToPixel();
this.imageWidth_ = imageSize[0];
}