diff options
Diffstat (limited to 'js/lib/geom')
-rwxr-xr-x | js/lib/geom/sub-path.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/js/lib/geom/sub-path.js b/js/lib/geom/sub-path.js index 4c5fe1eb..a9034def 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) { |