aboutsummaryrefslogtreecommitdiff
path: root/js/controllers/elements
diff options
context:
space:
mode:
Diffstat (limited to 'js/controllers/elements')
-rwxr-xr-xjs/controllers/elements/element-controller.js16
-rwxr-xr-xjs/controllers/elements/shapes-controller.js20
2 files changed, 21 insertions, 15 deletions
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, {
152 this.setProperty(el, "border-image", color.color.css); 152 this.setProperty(el, "border-image", color.color.css);
153 this.setProperty(el, "border-color", "none"); 153 this.setProperty(el, "border-color", "none");
154 if(color.borderInfo) { 154 if(color.borderInfo) {
155 this.setProperty(el, "border-width", color.borderInfo.borderWidth + color.borderInfo.borderUnits); 155 if(color.borderInfo.borderWidth) {
156 this.setProperty(el, "border-style", color.borderInfo.borderStyle); 156 this.setProperty(el, "border-width", color.borderInfo.borderWidth + color.borderInfo.borderUnits);
157 }
158 if(color.borderInfo.borderStyle) {
159 this.setProperty(el, "border-style", color.borderInfo.borderStyle);
160 }
157 } 161 }
158 break; 162 break;
159 default: 163 default:
160 this.setProperty(el, "border-image", "none"); 164 this.setProperty(el, "border-image", "none");
161 this.setProperty(el, "border-color", color.color.css); 165 this.setProperty(el, "border-color", color.color.css);
162 if(color.borderInfo) { 166 if(color.borderInfo) {
163 this.setProperty(el, "border-width", color.borderInfo.borderWidth + color.borderInfo.borderUnits); 167 if(color.borderInfo.borderWidth) {
164 this.setProperty(el, "border-style", color.borderInfo.borderStyle); 168 this.setProperty(el, "border-width", color.borderInfo.borderWidth + color.borderInfo.borderUnits);
169 }
170 if(color.borderInfo.borderStyle) {
171 this.setProperty(el, "border-style", color.borderInfo.borderStyle);
172 }
165 } 173 }
166 } 174 }
167 } 175 }
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, {
20 color; 20 color;
21 switch(p) { 21 switch(p) {
22 case "strokeSize": 22 case "strokeSize":
23 // TODO - For now, just handling px units.
24 this.setShapeProperty(el, "strokeSize", value); 23 this.setShapeProperty(el, "strokeSize", value);
24 var strokeInfo = value.split(" ");
25 val = this.GetValueInPixels(strokeInfo[0], strokeInfo[1]);
26
25 // TODO - For now, just handle Line, Rectangle and Oval. Eventually, move this into each class's 27 // TODO - For now, just handle Line, Rectangle and Oval. Eventually, move this into each class's
26 // setStrokeWidth code like SubPath and BrushStroke do. 28 // setStrokeWidth code like SubPath and BrushStroke do.
27 var geomType = el.elementModel.shapeModel.GLGeomObj.geomType(); 29 var geomType = el.elementModel.shapeModel.GLGeomObj.geomType();
@@ -527,16 +529,6 @@ exports.ShapesController = Montage.create(CanvasController, {
527 } 529 }
528 else 530 else
529 { 531 {
530 // Support for ink-bottle tool
531 if(color.strokeInfo)
532 {
533 var strokeWidth = this.GetValueInPixels(color.strokeInfo.strokeSize,
534 color.strokeInfo.strokeUnits);
535 el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(strokeWidth);
536 this.setShapeProperty(el, "strokeSize", color.strokeInfo.strokeSize + " "
537 + color.strokeInfo.strokeUnits);
538 }
539
540 if(mode) 532 if(mode)
541 { 533 {
542 switch (mode) { 534 switch (mode) {
@@ -559,6 +551,12 @@ exports.ShapesController = Montage.create(CanvasController, {
559 el.elementModel.shapeModel.GLGeomObj.setStrokeColor(webGl); 551 el.elementModel.shapeModel.GLGeomObj.setStrokeColor(webGl);
560 } 552 }
561 } 553 }
554
555 // Support for ink-bottle tool
556 if(color.strokeInfo)
557 {
558 this.setProperty(el, "strokeSize", color.strokeInfo.strokeSize + " " + color.strokeInfo.strokeUnits);
559 }
562 } 560 }
563 el.elementModel.shapeModel.GLWorld.render(); 561 el.elementModel.shapeModel.GLWorld.render();
564 this.application.ninja.documentController.activeDocument.needsSave = true; 562 this.application.ninja.documentController.activeDocument.needsSave = true;