mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-01 02:38:43 -05:00
Allow Matrix#applyToContext to optionally reset the matrix transformation.
This commit is contained in:
parent
12859d7a24
commit
a7429205ed
1 changed files with 12 additions and 5 deletions
|
@ -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: {
|
||||
|
|
Loading…
Reference in a new issue