From 1a53fb6061688d3204e48d8617e9fed50a04b204 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Fri, 6 Apr 2012 11:41:21 -0700 Subject: Don't update the plane matrix of subpaths that already have a plane matrix --- js/lib/geom/sub-path.js | 4 ++++ js/tools/PenTool.js | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/js/lib/geom/sub-path.js b/js/lib/geom/sub-path.js index bca4e1c5..d784fbc6 100755 --- a/js/lib/geom/sub-path.js +++ b/js/lib/geom/sub-path.js @@ -338,6 +338,10 @@ GLSubpath.prototype.setPlaneMatrix = function(planeMat){ this._planeMat = planeMat; }; +GLSubpath.prototype.getPlaneMatrix = function(){ + return this._planeMat; +}; + GLSubpath.prototype.setDragPlane = function(p){ this._dragPlane = p; }; diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index f310208e..96702756 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js @@ -410,10 +410,12 @@ exports.PenTool = Montage.create(ShapeTool, { ShowSelectedSubpath:{ value: function() { if (this._selectedSubpath){ - this._selectedSubpath.setPlaneMatrix(this._penPlaneMat); - var planeMatInv = glmat4.inverse( this._penPlaneMat, [] ); - this._selectedSubpath.setPlaneMatrixInverse(planeMatInv); - this._selectedSubpath.setDragPlane(this._dragPlane); + if (!this._selectedSubpath.getPlaneMatrix()) { + this._selectedSubpath.setPlaneMatrix(this._penPlaneMat); + var planeMatInv = glmat4.inverse( this._penPlaneMat, [] ); + this._selectedSubpath.setPlaneMatrixInverse(planeMatInv); + this._selectedSubpath.setDragPlane(this._dragPlane); + } this._selectedSubpath.createSamples(); //dirty bit is checked here this._selectedSubpath.buildLocalCoord(); //local dirty bit is checked here -- cgit v1.2.3