From e1a65d0c2a13e12ee53be98c731616e35aa07a41 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 28 Feb 2012 13:58:34 -0800 Subject: new anchor control guide rendering (smaller handles) and clamp min. width and height to 1 while resizing subpaths --- js/helper-classes/RDGE/GLSubpath.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'js/helper-classes/RDGE') 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() { this.setWidth = function (newW) { - //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) - //todo same as above for the setHeight function below + if (newW<1) + newW=1; //clamp minimum width to 1 //scale the contents of this subpath to lie within this width //determine the scale factor by comparing with the old width var oldWidth = this._BBoxMax[0]-this._BBoxMin[0]; @@ -210,6 +210,8 @@ function GLSubpath() { this.makeDirty(); } this.setHeight = function (newH) { + if (newH<1) + newH=1; //clamp minimum width to 1 //scale the contents of this subpath to lie within this height //determine the scale factor by comparing with the old height var oldHeight = this._BBoxMax[1]-this._BBoxMin[1]; -- cgit v1.2.3