mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-03-13 16:33:28 -04:00
Change method sequence a bit.
This commit is contained in:
parent
160f3d55c7
commit
fc52944ee8
1 changed files with 13 additions and 13 deletions
|
@ -152,6 +152,13 @@ var View = this.View = Base.extend({
|
|||
this._transform(new Matrix().translate(Point.read(arguments).negate()));
|
||||
},
|
||||
|
||||
_transform: function(matrix, flags) {
|
||||
this._matrix.preConcatenate(matrix);
|
||||
// Force recalculation of these values next time they are requested.
|
||||
this._bounds = null;
|
||||
this._inverse = null;
|
||||
},
|
||||
|
||||
draw: function() {
|
||||
if (this._stats)
|
||||
this._stats.update();
|
||||
|
@ -184,19 +191,6 @@ var View = this.View = Base.extend({
|
|||
return !!res.length;
|
||||
},
|
||||
|
||||
_transform: function(matrix, flags) {
|
||||
this._matrix.preConcatenate(matrix);
|
||||
// Force recalculation of these values next time they are requested.
|
||||
this._bounds = null;
|
||||
this._inverse = null;
|
||||
},
|
||||
|
||||
_getInverse: function() {
|
||||
if (!this._inverse)
|
||||
this._inverse = this._matrix.createInverse();
|
||||
return this._inverse;
|
||||
},
|
||||
|
||||
// TODO: getInvalidBounds
|
||||
// TODO: invalidate(rect)
|
||||
// TODO: style: artwork / preview / raster / opaque / ink
|
||||
|
@ -213,6 +207,12 @@ var View = this.View = Base.extend({
|
|||
return this._getInverse()._transformPoint(Point.read(arguments));
|
||||
},
|
||||
|
||||
_getInverse: function() {
|
||||
if (!this._inverse)
|
||||
this._inverse = this._matrix.createInverse();
|
||||
return this._inverse;
|
||||
},
|
||||
|
||||
/**
|
||||
* Handler to be called whenever a view gets resized.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue