Skip to content

Commit cd74aaf

Browse files
committed
Remove caching of inverse transform.
View#matrix can be directly modified, and we don't have change tracking on matrices yet.
1 parent 19f50be commit cd74aaf

1 file changed

Lines changed: 2 additions & 9 deletions

File tree

src/ui/View.js

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,6 @@ var View = Base.extend(Callback, /** @lends View# */{
256256
this._matrix.concatenate(matrix);
257257
// Force recalculation of these values next time they are requested.
258258
this._bounds = null;
259-
this._inverse = null;
260259
this._redraw();
261260
},
262261

@@ -307,7 +306,7 @@ var View = Base.extend(Callback, /** @lends View# */{
307306
*/
308307
getBounds: function() {
309308
if (!this._bounds)
310-
this._bounds = this._getInverse()._transformBounds(
309+
this._bounds = this._matrix.inverted()._transformBounds(
311310
new Rectangle(new Point(), this._viewSize));
312311
return this._bounds;
313312
},
@@ -398,15 +397,9 @@ var View = Base.extend(Callback, /** @lends View# */{
398397
},
399398

400399
viewToProject: function(/* point */) {
401-
return this._getInverse()._transformPoint(Point.read(arguments));
400+
return this._matrix._inverseTransform(Point.read(arguments));
402401
},
403402

404-
_getInverse: function() {
405-
if (!this._inverse)
406-
this._inverse = this._matrix.inverted();
407-
return this._inverse;
408-
}
409-
410403
/**
411404
* {@grouptitle Event Handlers}
412405
* Handler function to be called on each frame of an animation.

0 commit comments

Comments
 (0)