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.
*/
applyToContext: function(context) {
context.setTransform(
this._m00, this._m01, this._m10,
this._m11, this._m02, this._m12
);
applyToContext: function(context, reset) {
if (reset) {
context.setTransform(
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: {