diff options
author | Pushkar Joshi | 2012-04-06 11:41:21 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-04-06 11:41:21 -0700 |
commit | 1a53fb6061688d3204e48d8617e9fed50a04b204 (patch) | |
tree | 8eb032d3798248e10f408a50ead37223e709d8a0 | |
parent | 6b3d915b94d1263252448bd5a4ebeef4534b9528 (diff) | |
download | ninja-1a53fb6061688d3204e48d8617e9fed50a04b204.tar.gz |
Don't update the plane matrix of subpaths that already have a plane matrix
-rwxr-xr-x | js/lib/geom/sub-path.js | 4 | ||||
-rwxr-xr-x | 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){ | |||
338 | this._planeMat = planeMat; | 338 | this._planeMat = planeMat; |
339 | }; | 339 | }; |
340 | 340 | ||
341 | GLSubpath.prototype.getPlaneMatrix = function(){ | ||
342 | return this._planeMat; | ||
343 | }; | ||
344 | |||
341 | GLSubpath.prototype.setDragPlane = function(p){ | 345 | GLSubpath.prototype.setDragPlane = function(p){ |
342 | this._dragPlane = p; | 346 | this._dragPlane = p; |
343 | }; | 347 | }; |
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, { | |||
410 | ShowSelectedSubpath:{ | 410 | ShowSelectedSubpath:{ |
411 | value: function() { | 411 | value: function() { |
412 | if (this._selectedSubpath){ | 412 | if (this._selectedSubpath){ |
413 | this._selectedSubpath.setPlaneMatrix(this._penPlaneMat); | 413 | if (!this._selectedSubpath.getPlaneMatrix()) { |
414 | var planeMatInv = glmat4.inverse( this._penPlaneMat, [] ); | 414 | this._selectedSubpath.setPlaneMatrix(this._penPlaneMat); |
415 | this._selectedSubpath.setPlaneMatrixInverse(planeMatInv); | 415 | var planeMatInv = glmat4.inverse( this._penPlaneMat, [] ); |
416 | this._selectedSubpath.setDragPlane(this._dragPlane); | 416 | this._selectedSubpath.setPlaneMatrixInverse(planeMatInv); |
417 | this._selectedSubpath.setDragPlane(this._dragPlane); | ||
418 | } | ||
417 | 419 | ||
418 | this._selectedSubpath.createSamples(); //dirty bit is checked here | 420 | this._selectedSubpath.createSamples(); //dirty bit is checked here |
419 | this._selectedSubpath.buildLocalCoord(); //local dirty bit is checked here | 421 | this._selectedSubpath.buildLocalCoord(); //local dirty bit is checked here |