From a0daa3668883c8c35ce277b60509a3a3dcf303b2 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 24 Apr 2012 11:42:42 -0700 Subject: Allow users to toggle application of stroke and border settings when using the ink bottle tool. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) (limited to 'js/controllers/elements/shapes-controller.js') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index e9dde5fc..3ada5f82 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -20,8 +20,10 @@ exports.ShapesController = Montage.create(CanvasController, { color; switch(p) { case "strokeSize": - // TODO - For now, just handling px units. this.setShapeProperty(el, "strokeSize", value); + var strokeInfo = value.split(" "); + val = this.GetValueInPixels(strokeInfo[0], strokeInfo[1]); + // TODO - For now, just handle Line, Rectangle and Oval. Eventually, move this into each class's // setStrokeWidth code like SubPath and BrushStroke do. var geomType = el.elementModel.shapeModel.GLGeomObj.geomType(); @@ -527,16 +529,6 @@ exports.ShapesController = Montage.create(CanvasController, { } else { - // Support for ink-bottle tool - if(color.strokeInfo) - { - var strokeWidth = this.GetValueInPixels(color.strokeInfo.strokeSize, - color.strokeInfo.strokeUnits); - el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(strokeWidth); - this.setShapeProperty(el, "strokeSize", color.strokeInfo.strokeSize + " " - + color.strokeInfo.strokeUnits); - } - if(mode) { switch (mode) { @@ -559,6 +551,12 @@ exports.ShapesController = Montage.create(CanvasController, { el.elementModel.shapeModel.GLGeomObj.setStrokeColor(webGl); } } + + // Support for ink-bottle tool + if(color.strokeInfo) + { + this.setProperty(el, "strokeSize", color.strokeInfo.strokeSize + " " + color.strokeInfo.strokeUnits); + } } el.elementModel.shapeModel.GLWorld.render(); this.application.ninja.documentController.activeDocument.needsSave = true; -- cgit v1.2.3 From d5510229ebd4549ce435e3947874cc37eef27ffb Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 24 Apr 2012 14:27:54 -0700 Subject: Fixed issue with setting stroke when using the PI. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/shapes-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/controllers/elements/shapes-controller.js') diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js index 3ada5f82..8d7b74f0 100755 --- a/js/controllers/elements/shapes-controller.js +++ b/js/controllers/elements/shapes-controller.js @@ -21,7 +21,7 @@ exports.ShapesController = Montage.create(CanvasController, { switch(p) { case "strokeSize": this.setShapeProperty(el, "strokeSize", value); - var strokeInfo = value.split(" "); + var strokeInfo = njModule.NJUtils.getValueAndUnits(value); val = this.GetValueInPixels(strokeInfo[0], strokeInfo[1]); // TODO - For now, just handle Line, Rectangle and Oval. Eventually, move this into each class's -- cgit v1.2.3