mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-05 20:32:00 -05:00
Rename Matrix#createInverse() to #inverted() and #createShiftless() to #shiftless().
This commit is contained in:
parent
d70fdb69d3
commit
b10454a83c
5 changed files with 6 additions and 6 deletions
|
@ -618,7 +618,7 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
|
|||
* @return {Matrix} The inverted matrix, or {@code null }, if the matrix is
|
||||
* singular
|
||||
*/
|
||||
createInverse: function() {
|
||||
inverted: function() {
|
||||
var det = this._getDeterminant();
|
||||
return det && Matrix.create(
|
||||
this._d / det,
|
||||
|
@ -629,7 +629,7 @@ var Matrix = this.Matrix = Base.extend(/** @lends Matrix# */{
|
|||
(this._c * this._tx - this._a * this._ty) / det);
|
||||
},
|
||||
|
||||
createShiftless: function() {
|
||||
shiftless: function() {
|
||||
return Matrix.create(this._a, this._c, this._b, this._d, 0, 0);
|
||||
},
|
||||
|
||||
|
|
|
@ -1997,7 +1997,7 @@ statics: {
|
|||
// and calculate the bounding box of the resulting rotated elipse:
|
||||
// Get rotated hor and ver vectors, and determine rotation angle
|
||||
// and elipse values from them:
|
||||
var mx = matrix.createShiftless(),
|
||||
var mx = matrix.shiftless(),
|
||||
hor = mx.transform(Point.create(radius, 0)),
|
||||
ver = mx.transform(Point.create(0, radius)),
|
||||
phi = hor.getAngleInRadians(),
|
||||
|
|
|
@ -53,7 +53,7 @@ new function() {
|
|||
// in rotate(). To do so, SVG requries us to inverse transform the
|
||||
// translation point by the matrix itself, since they are provided
|
||||
// in local coordinates.
|
||||
matrix = matrix.createShiftless();
|
||||
matrix = matrix.shiftless();
|
||||
var point = matrix._inverseTransform(trans);
|
||||
attrs.x = point.x;
|
||||
attrs.y = point.y;
|
||||
|
|
|
@ -454,7 +454,7 @@ new function() {
|
|||
scale = size ? rectangle.getSize().divide(size) : 1,
|
||||
offset = rectangle.getPoint(),
|
||||
matrix = new Matrix().translate(offset).scale(scale);
|
||||
item.transform(matrix.createInverse());
|
||||
item.transform(matrix.inverted());
|
||||
if (size)
|
||||
rectangle.setSize(size);
|
||||
rectangle.setPoint(0);
|
||||
|
|
|
@ -393,7 +393,7 @@ var View = this.View = Base.extend(Callback, /** @lends View# */{
|
|||
|
||||
_getInverse: function() {
|
||||
if (!this._inverse)
|
||||
this._inverse = this._matrix.createInverse();
|
||||
this._inverse = this._matrix.inverted();
|
||||
return this._inverse;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue