aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
authorPushkar Joshi2012-05-22 13:24:23 -0700
committerPushkar Joshi2012-05-22 13:24:23 -0700
commiteea0a556e44c2b60d3aaf6e46d2432d3e6303812 (patch)
tree629352d8c01214a0fa1a08be1f4a4961aa64aa32 /js/lib
parent01dbc1f329a95bc7e3b93224543d88ad5bdbd315 (diff)
parentf4df8204a57e1bc6021b651ebb2259f9931cf26f (diff)
downloadninja-eea0a556e44c2b60d3aaf6e46d2432d3e6303812.tar.gz
Merge branch 'pentool' into brushtool
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 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) {