mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-08-14 06:59:06 -04:00
Introduce Matrix#setIdentity().
This commit is contained in:
parent
a8392fbf68
commit
f2d7b85616
2 changed files with 7 additions and 5 deletions
src/basic
|
@ -66,8 +66,7 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
|
|||
ok = false;
|
||||
}
|
||||
} else if (count == 0) {
|
||||
this._a = this._d = 1;
|
||||
this._c = this._b = this._tx = this._ty = 0;
|
||||
this.setIdentity();
|
||||
} else {
|
||||
ok = false;
|
||||
}
|
||||
|
@ -104,6 +103,11 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
|
|||
return this;
|
||||
},
|
||||
|
||||
setIdentity: function() {
|
||||
this._a = this._d = 1;
|
||||
this._c = this._b = this._tx = this._ty = 0;
|
||||
},
|
||||
|
||||
/**
|
||||
* Concatentates this transform with a scaling transformation.
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue