Add an optinonal dest parameter to Matrix#_transformPoint().

This commit is contained in:
Jürg Lehni 2011-05-16 11:07:39 +01:00
parent 71bf4fdbca
commit 9384fb4fb5

View file

@ -301,10 +301,12 @@ var Matrix = this.Matrix = Base.extend({
* A faster version of transform that only takes one point and does not
* attempt to convert it.
*/
_transformPoint: function(point) {
_transformPoint: function(point, dest) {
var x = point.x,
y = point.y;
return Point.create(
if (!dest)
dest = new Point(Point.dont);
return dest.set(
x * this._m00 + y * this._m01 + this._m02,
x * this._m10 + y * this._m11 + this._m12
);