aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes')
-rwxr-xr-xjs/helper-classes/RDGE/GLSubpath.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/helper-classes/RDGE/GLSubpath.js b/js/helper-classes/RDGE/GLSubpath.js
index 7beb11b9..f3d8ad36 100755
--- a/js/helper-classes/RDGE/GLSubpath.js
+++ b/js/helper-classes/RDGE/GLSubpath.js
@@ -181,8 +181,8 @@ function GLSubpath() {
181 181
182 182
183 this.setWidth = function (newW) { 183 this.setWidth = function (newW) {
184 //todo this doesn't work in cases where the newW is zero or if the previous width was 0/1 (i.e. the path had become degenerate in width) 184 if (newW<1)
185 //todo same as above for the setHeight function below 185 newW=1; //clamp minimum width to 1
186 //scale the contents of this subpath to lie within this width 186 //scale the contents of this subpath to lie within this width
187 //determine the scale factor by comparing with the old width 187 //determine the scale factor by comparing with the old width
188 var oldWidth = this._BBoxMax[0]-this._BBoxMin[0]; 188 var oldWidth = this._BBoxMax[0]-this._BBoxMin[0];
@@ -210,6 +210,8 @@ function GLSubpath() {
210 this.makeDirty(); 210 this.makeDirty();
211 } 211 }
212 this.setHeight = function (newH) { 212 this.setHeight = function (newH) {
213 if (newH<1)
214 newH=1; //clamp minimum width to 1
213 //scale the contents of this subpath to lie within this height 215 //scale the contents of this subpath to lie within this height
214 //determine the scale factor by comparing with the old height 216 //determine the scale factor by comparing with the old height
215 var oldHeight = this._BBoxMax[1]-this._BBoxMin[1]; 217 var oldHeight = this._BBoxMax[1]-this._BBoxMin[1];