Allow Matrix#applyToContext to optionally reset the matrix transformation.

This commit is contained in:
Jonathan Puckey 2011-02-28 18:27:57 +01:00
parent 12859d7a24
commit a7429205ed

View file

@ -454,11 +454,18 @@ var Matrix = Base.extend({
/** /**
* Applies this matrix to the specified Canvas Context. * Applies this matrix to the specified Canvas Context.
*/ */
applyToContext: function(context) { applyToContext: function(context, reset) {
context.setTransform( if (reset) {
this._m00, this._m01, this._m10, context.setTransform(
this._m11, this._m02, this._m12 this._m00, this._m01, this._m10,
); this._m11, this._m02, this._m12
);
} else {
context.transform(
this._m00, this._m01, this._m10,
this._m11, this._m02, this._m12
);
}
}, },
statics: { statics: {