aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
authorPushkar Joshi2012-05-11 08:55:07 -0700
committerPushkar Joshi2012-05-11 08:55:07 -0700
commitde9f718b739ef2b31a161d9dac6e81d614fab853 (patch)
treeddbad9c15c7e6884b8285479a9d9fd847ff93ad0 /js/lib
parente5ae6e0b6e54db0e6efd75d1f14cb791060ed67a (diff)
downloadninja-de9f718b739ef2b31a161d9dac6e81d614fab853.tar.gz
code cleanup and starting the subtool functionality
Diffstat (limited to 'js/lib')
-rwxr-xr-xjs/lib/geom/sub-path.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/js/lib/geom/sub-path.js b/js/lib/geom/sub-path.js
index 56c94df3..24acb2b0 100755
--- a/js/lib/geom/sub-path.js
+++ b/js/lib/geom/sub-path.js
@@ -166,6 +166,8 @@ var GLSubpath = function GLSubpath() {
166 }; 166 };
167 167
168 this.setWidth = function (newW) { 168 this.setWidth = function (newW) {
169 var strokeWidth = this._strokeWidth;
170 var halfStrokeWidth = strokeWidth*0.5;
169 if (newW<1) { 171 if (newW<1) {
170 newW=1; //clamp minimum width to 1 172 newW=1; //clamp minimum width to 1
171 } 173 }
@@ -183,7 +185,7 @@ var GLSubpath = function GLSubpath() {
183 } 185 }
184 186
185 //scale the anchor point positions such that the width of the bbox is the newW 187 //scale the anchor point positions such that the width of the bbox is the newW
186 var origX = this._BBoxMin[0]; 188 var origX = this._BBoxMin[0]; //this should always be zero since we only deal with local coordinates
187 var numAnchors = this._Anchors.length; 189 var numAnchors = this._Anchors.length;
188 for (var i=0;i<numAnchors;i++){ 190 for (var i=0;i<numAnchors;i++){
189 //compute the distance from the bboxMin 191 //compute the distance from the bboxMin
@@ -196,6 +198,7 @@ var GLSubpath = function GLSubpath() {
196 this._Anchors[i].setNextPos(origX + nextW*scaleX,this._Anchors[i].getNextY(),this._Anchors[i].getNextZ()); 198 this._Anchors[i].setNextPos(origX + nextW*scaleX,this._Anchors[i].getNextY(),this._Anchors[i].getNextZ());
197 } 199 }
198 this.makeDirty(); 200 this.makeDirty();
201 this.computeBoundingBox(true, false);
199 }; 202 };
200 203
201 this.setHeight = function (newH) { 204 this.setHeight = function (newH) {