Sort miscellaneous properties and add rotation and scale

This commit is contained in:
Tom Payne
2013-12-19 15:36:24 +01:00
parent b3f77b4d68
commit fe2f028777
+10 -4
View File
@@ -60,11 +60,13 @@ ol.render.canvas.Immediate = function(context, pixelRatio, extent, transform) {
* fillStyle: (string|undefined), * fillStyle: (string|undefined),
* strokeStyle: (string|undefined), * strokeStyle: (string|undefined),
* lineWidth: (number|undefined), * lineWidth: (number|undefined),
* image: (HTMLCanvasElement|HTMLVideoElement|Image),
* anchorX: (number|undefined), * anchorX: (number|undefined),
* anchorY: (number|undefined), * anchorY: (number|undefined),
* image: (HTMLCanvasElement|HTMLVideoElement|Image),
* height: (number|undefined), * height: (number|undefined),
* width: (number|undefined), * width: (number|undefined),
* scale: number,
* rotation: number,
* lineCap: (string|undefined), * lineCap: (string|undefined),
* lineDash: Array.<number>, * lineDash: Array.<number>,
* lineJoin: (string|undefined), * lineJoin: (string|undefined),
@@ -83,10 +85,12 @@ ol.render.canvas.Immediate = function(context, pixelRatio, extent, transform) {
fillStyle: undefined, fillStyle: undefined,
strokeStyle: undefined, strokeStyle: undefined,
lineWidth: undefined, lineWidth: undefined,
image: null,
anchorX: undefined, anchorX: undefined,
anchorY: undefined, anchorY: undefined,
image: null,
height: undefined, height: undefined,
rotation: 0,
scale: 1,
width: undefined, width: undefined,
lineCap: undefined, lineCap: undefined,
lineDash: null, lineDash: null,
@@ -469,12 +473,14 @@ ol.render.canvas.Immediate.prototype.setImageStyle = function(imageStyle) {
var image = imageStyle.getImage(1); var image = imageStyle.getImage(1);
goog.asserts.assert(!goog.isNull(image)); goog.asserts.assert(!goog.isNull(image));
var state = this.state_; var state = this.state_;
state.image = image;
state.anchorX = anchor[0]; state.anchorX = anchor[0];
state.anchorY = anchor[1]; state.anchorY = anchor[1];
state.image = image;
state.width = size[0];
state.height = size[1]; state.height = size[1];
state.rotation = imageStyle.getRotation();
state.scale = imageStyle.getScale();
state.snapToPixel = imageStyle.getSnapToPixel(); state.snapToPixel = imageStyle.getSnapToPixel();
state.width = size[0];
} }
}; };