From c5e66f69b108e359b00c8fd897a4278812484c55 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Fri, 20 Apr 2012 12:09:54 -0700 Subject: Fixing translate handles to draw without zoom value. Also fixed some typos in zoom code. Signed-off-by: Nivesh Rajbhandari --- js/controllers/elements/stage-controller.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/stage-controller.js b/js/controllers/elements/stage-controller.js index 3ef7dacc..e9779c81 100755 --- a/js/controllers/elements/stage-controller.js +++ b/js/controllers/elements/stage-controller.js @@ -182,5 +182,5 @@ exports.StageController = Montage.create(ElementController, { return dist; } } - }, + } }); -- cgit v1.2.3 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/element-controller.js | 16 ++++++++++++---- js/controllers/elements/shapes-controller.js | 20 +++++++++----------- 2 files changed, 21 insertions(+), 15 deletions(-) (limited to 'js/controllers/elements') diff --git a/js/controllers/elements/element-controller.js b/js/controllers/elements/element-controller.js index 35a543ac..452d09f1 100755 --- a/js/controllers/elements/element-controller.js +++ b/js/controllers/elements/element-controller.js @@ -152,16 +152,24 @@ exports.ElementController = Montage.create(Component, { this.setProperty(el, "border-image", color.color.css); this.setProperty(el, "border-color", "none"); if(color.borderInfo) { - this.setProperty(el, "border-width", color.borderInfo.borderWidth + color.borderInfo.borderUnits); - this.setProperty(el, "border-style", color.borderInfo.borderStyle); + if(color.borderInfo.borderWidth) { + this.setProperty(el, "border-width", color.borderInfo.borderWidth + color.borderInfo.borderUnits); + } + if(color.borderInfo.borderStyle) { + this.setProperty(el, "border-style", color.borderInfo.borderStyle); + } } break; default: this.setProperty(el, "border-image", "none"); this.setProperty(el, "border-color", color.color.css); if(color.borderInfo) { - this.setProperty(el, "border-width", color.borderInfo.borderWidth + color.borderInfo.borderUnits); - this.setProperty(el, "border-style", color.borderInfo.borderStyle); + if(color.borderInfo.borderWidth) { + this.setProperty(el, "border-width", color.borderInfo.borderWidth + color.borderInfo.borderUnits); + } + if(color.borderInfo.borderStyle) { + this.setProperty(el, "border-style", color.borderInfo.borderStyle); + } } } } 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') 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