Remove use of goog.vec.*
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
goog.provide('ol.render.canvas.Immediate');
|
||||
|
||||
goog.require('goog.asserts');
|
||||
goog.require('goog.vec.Mat4');
|
||||
goog.require('ol.matrix');
|
||||
goog.require('ol.array');
|
||||
goog.require('ol.color');
|
||||
goog.require('ol.colorlike');
|
||||
@@ -15,7 +15,6 @@ goog.require('ol.geom.flat.transform');
|
||||
goog.require('ol.has');
|
||||
goog.require('ol.render.VectorContext');
|
||||
goog.require('ol.render.canvas');
|
||||
goog.require('ol.vec.Mat4');
|
||||
|
||||
|
||||
/**
|
||||
@@ -32,7 +31,7 @@ goog.require('ol.vec.Mat4');
|
||||
* @param {CanvasRenderingContext2D} context Context.
|
||||
* @param {number} pixelRatio Pixel ratio.
|
||||
* @param {ol.Extent} extent Extent.
|
||||
* @param {goog.vec.Mat4.Number} transform Transform.
|
||||
* @param {ol.Matrix} transform Transform.
|
||||
* @param {number} viewRotation View rotation.
|
||||
* @struct
|
||||
*/
|
||||
@@ -59,7 +58,7 @@ ol.render.canvas.Immediate = function(context, pixelRatio, extent, transform, vi
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {goog.vec.Mat4.Number}
|
||||
* @type {ol.Matrix}
|
||||
*/
|
||||
this.transform_ = transform;
|
||||
|
||||
@@ -227,9 +226,9 @@ ol.render.canvas.Immediate = function(context, pixelRatio, extent, transform, vi
|
||||
|
||||
/**
|
||||
* @private
|
||||
* @type {!goog.vec.Mat4.Number}
|
||||
* @type {ol.Matrix}
|
||||
*/
|
||||
this.tmpLocalTransform_ = goog.vec.Mat4.createNumber();
|
||||
this.tmpLocalTransform_ = ol.matrix.create();
|
||||
|
||||
};
|
||||
ol.inherits(ol.render.canvas.Immediate, ol.render.VectorContext);
|
||||
@@ -273,16 +272,10 @@ ol.render.canvas.Immediate.prototype.drawImages_ = function(flatCoordinates, off
|
||||
if (rotation !== 0 || this.imageScale_ != 1) {
|
||||
var centerX = x + this.imageAnchorX_;
|
||||
var centerY = y + this.imageAnchorY_;
|
||||
ol.vec.Mat4.makeTransform2D(localTransform,
|
||||
ol.matrix.makeTransform(localTransform,
|
||||
centerX, centerY, this.imageScale_, this.imageScale_,
|
||||
rotation, -centerX, -centerY);
|
||||
context.setTransform(
|
||||
goog.vec.Mat4.getElement(localTransform, 0, 0),
|
||||
goog.vec.Mat4.getElement(localTransform, 1, 0),
|
||||
goog.vec.Mat4.getElement(localTransform, 0, 1),
|
||||
goog.vec.Mat4.getElement(localTransform, 1, 1),
|
||||
goog.vec.Mat4.getElement(localTransform, 0, 3),
|
||||
goog.vec.Mat4.getElement(localTransform, 1, 3));
|
||||
context.setTransform.apply(context, localTransform);
|
||||
}
|
||||
context.drawImage(this.image_, this.imageOriginX_, this.imageOriginY_,
|
||||
this.imageWidth_, this.imageHeight_, x, y,
|
||||
@@ -326,15 +319,9 @@ ol.render.canvas.Immediate.prototype.drawText_ = function(flatCoordinates, offse
|
||||
var x = pixelCoordinates[offset] + this.textOffsetX_;
|
||||
var y = pixelCoordinates[offset + 1] + this.textOffsetY_;
|
||||
if (this.textRotation_ !== 0 || this.textScale_ != 1) {
|
||||
var localTransform = ol.vec.Mat4.makeTransform2D(this.tmpLocalTransform_,
|
||||
var localTransform = ol.matrix.makeTransform(this.tmpLocalTransform_,
|
||||
x, y, this.textScale_, this.textScale_, this.textRotation_, -x, -y);
|
||||
context.setTransform(
|
||||
goog.vec.Mat4.getElement(localTransform, 0, 0),
|
||||
goog.vec.Mat4.getElement(localTransform, 1, 0),
|
||||
goog.vec.Mat4.getElement(localTransform, 0, 1),
|
||||
goog.vec.Mat4.getElement(localTransform, 1, 1),
|
||||
goog.vec.Mat4.getElement(localTransform, 0, 3),
|
||||
goog.vec.Mat4.getElement(localTransform, 1, 3));
|
||||
context.setTransform.apply(context, localTransform);
|
||||
}
|
||||
if (this.textStrokeState_) {
|
||||
context.strokeText(this.text_, x, y);
|
||||
|
||||
Reference in New Issue
Block a user