mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05:00
Introduce Matrix#setIdentity().
This commit is contained in:
parent
a8392fbf68
commit
f2d7b85616
2 changed files with 7 additions and 5 deletions
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -1861,9 +1861,7 @@ function(name) {
|
|||
// access and code minification.
|
||||
if (this._applyMatrix(this._matrix)) {
|
||||
// Set _matrix to the identity
|
||||
// TODO: Introduce Matrix#setIdentity() and use it from
|
||||
// #initialize() too?
|
||||
this._matrix.initialize();
|
||||
this._matrix.setIdentity();
|
||||
// TODO: This needs a _changed notification, but the GEOMETRY
|
||||
// actually sdoesnt change! What to do?
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue