aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
Diffstat (limited to 'js')
-rwxr-xr-xjs/components/ui/color-chip.reel/color-chip.js15
-rwxr-xr-xjs/controllers/elements/shapes-controller.js11
-rwxr-xr-xjs/data/tools-data.js2
-rwxr-xr-xjs/document/html-document.js5
-rwxr-xr-xjs/helper-classes/3D/snap-manager.js6
-rwxr-xr-xjs/helper-classes/3D/view-utils.js3
-rwxr-xr-xjs/helper-classes/RDGE/GLBrushStroke.js175
-rw-r--r--js/mediators/io-mediator.js17
-rwxr-xr-xjs/panels/properties/content.reel/content.js22
-rwxr-xr-xjs/panels/properties/sections/custom-rows/color-select.reel/color-select.html4
-rwxr-xr-xjs/panels/properties/sections/custom-rows/color-select.reel/color-select.js21
-rwxr-xr-xjs/panels/properties/sections/custom.reel/custom.js5
-rw-r--r--[-rwxr-xr-x]js/tools/BrushTool.js194
-rwxr-xr-xjs/tools/SelectionTool.js16
14 files changed, 376 insertions, 120 deletions
diff --git a/js/components/ui/color-chip.reel/color-chip.js b/js/components/ui/color-chip.reel/color-chip.js
index ed1ac27a..7a7411da 100755
--- a/js/components/ui/color-chip.reel/color-chip.js
+++ b/js/components/ui/color-chip.reel/color-chip.js
@@ -92,6 +92,21 @@ var ColorChip = exports.ColorChip = Montage.create(Component, {
92 this.changeDelegate(evt); 92 this.changeDelegate(evt);
93 } 93 }
94 } 94 }
95 },
96
97 destroy: {
98 value: function() {
99 this.application.ninja.colorController.removeButton(this.mode, this.chipBtn);
100 var mode = this.mode;
101 if(this.iconType) {
102 if(this.iconType === "fillIcon") {
103 mode = "fill";
104 } else if(this.iconType === "strokeIcon") {
105 mode = "stroke";
106 }
107 }
108 this.application.ninja.colorController.removeButton(mode, this.icon);
109 }
95 } 110 }
96 111
97}); 112});
diff --git a/js/controllers/elements/shapes-controller.js b/js/controllers/elements/shapes-controller.js
index e0bff70c..749a1dd9 100755
--- a/js/controllers/elements/shapes-controller.js
+++ b/js/controllers/elements/shapes-controller.js
@@ -19,43 +19,51 @@ exports.ShapesController = Montage.create(CanvasController, {
19 this.setShapeProperty(el, "strokeSize", value); 19 this.setShapeProperty(el, "strokeSize", value);
20 el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(val); 20 el.elementModel.shapeModel.GLGeomObj.setStrokeWidth(val);
21 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 21 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
22 el.elementModel.shapeModel.GLWorld.render();
22 break; 23 break;
23 case "innerRadius": 24 case "innerRadius":
24 this.setShapeProperty(el, "innerRadius", value); 25 this.setShapeProperty(el, "innerRadius", value);
25 el.elementModel.shapeModel.GLGeomObj.setInnerRadius(val/100); 26 el.elementModel.shapeModel.GLGeomObj.setInnerRadius(val/100);
26 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 27 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
28 el.elementModel.shapeModel.GLWorld.render();
27 break; 29 break;
28 case "tlRadius": 30 case "tlRadius":
29 this.setShapeProperty(el, "tlRadius", value); 31 this.setShapeProperty(el, "tlRadius", value);
30 el.elementModel.shapeModel.GLGeomObj.setTLRadius(val); 32 el.elementModel.shapeModel.GLGeomObj.setTLRadius(val);
31 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 33 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
34 el.elementModel.shapeModel.GLWorld.render();
32 break; 35 break;
33 case "trRadius": 36 case "trRadius":
34 this.setShapeProperty(el, "trRadius", value); 37 this.setShapeProperty(el, "trRadius", value);
35 el.elementModel.shapeModel.GLGeomObj.setTRRadius(val); 38 el.elementModel.shapeModel.GLGeomObj.setTRRadius(val);
36 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 39 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
40 el.elementModel.shapeModel.GLWorld.render();
37 break; 41 break;
38 case "blRadius": 42 case "blRadius":
39 this.setShapeProperty(el, "blRadius", value); 43 this.setShapeProperty(el, "blRadius", value);
40 el.elementModel.shapeModel.GLGeomObj.setBLRadius(val); 44 el.elementModel.shapeModel.GLGeomObj.setBLRadius(val);
41 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 45 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
46 el.elementModel.shapeModel.GLWorld.render();
42 break; 47 break;
43 case "brRadius": 48 case "brRadius":
44 this.setShapeProperty(el, "brRadius", value); 49 this.setShapeProperty(el, "brRadius", value);
45 el.elementModel.shapeModel.GLGeomObj.setBRRadius(val); 50 el.elementModel.shapeModel.GLGeomObj.setBRRadius(val);
46 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 51 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
52 el.elementModel.shapeModel.GLWorld.render();
47 break; 53 break;
48 case "width": 54 case "width":
49 el.elementModel.shapeModel.GLGeomObj.setWidth(val); 55 el.elementModel.shapeModel.GLGeomObj.setWidth(val);
50 CanvasController.setProperty(el, p, value); 56 CanvasController.setProperty(el, p, value);
51 el.elementModel.shapeModel.GLWorld.setViewportFromCanvas(el); 57 el.elementModel.shapeModel.GLWorld.setViewportFromCanvas(el);
52 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 58 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
59 el.elementModel.shapeModel.GLWorld.render();
53 break; 60 break;
54 case "height": 61 case "height":
55 el.elementModel.shapeModel.GLGeomObj.setHeight(val); 62 el.elementModel.shapeModel.GLGeomObj.setHeight(val);
56 CanvasController.setProperty(el, p, value); 63 CanvasController.setProperty(el, p, value);
57 el.elementModel.shapeModel.GLWorld.setViewportFromCanvas(el); 64 el.elementModel.shapeModel.GLWorld.setViewportFromCanvas(el);
58 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 65 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
66 el.elementModel.shapeModel.GLWorld.render();
59 break; 67 break;
60 case "useWebGl": 68 case "useWebGl":
61 var canvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", el.className, true); 69 var canvas = njModule.NJUtils.makeNJElement("canvas", "Canvas", "shape", el.className, true);
@@ -76,6 +84,7 @@ exports.ShapesController = Montage.create(CanvasController, {
76 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm); 84 el.elementModel.shapeModel.GLGeomObj.setStrokeMaterial(sm);
77 el.elementModel.shapeModel.strokeMaterial = sm; 85 el.elementModel.shapeModel.strokeMaterial = sm;
78 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 86 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
87 el.elementModel.shapeModel.GLWorld.render();
79 } 88 }
80 break; 89 break;
81 case "fillMaterial": 90 case "fillMaterial":
@@ -85,12 +94,12 @@ exports.ShapesController = Montage.create(CanvasController, {
85 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm); 94 el.elementModel.shapeModel.GLGeomObj.setFillMaterial(fm);
86 el.elementModel.shapeModel.fillMaterial = fm; 95 el.elementModel.shapeModel.fillMaterial = fm;
87 el.elementModel.shapeModel.GLGeomObj.buildBuffers(); 96 el.elementModel.shapeModel.GLGeomObj.buildBuffers();
97 el.elementModel.shapeModel.GLWorld.render();
88 } 98 }
89 break; 99 break;
90 default: 100 default:
91 CanvasController.setProperty(el, p, value); 101 CanvasController.setProperty(el, p, value);
92 } 102 }
93 el.elementModel.shapeModel.GLWorld.render();
94 } 103 }
95 }, 104 },
96 105
diff --git a/js/data/tools-data.js b/js/data/tools-data.js
index a3a30b57..faf3336f 100755
--- a/js/data/tools-data.js
+++ b/js/data/tools-data.js
@@ -141,7 +141,7 @@ exports.ToolsData = Montage.create(Montage, {
141 "spriteSheet": true, 141 "spriteSheet": true,
142 "action": "BrushTool", 142 "action": "BrushTool",
143 "toolTip": "Brush Tool", 143 "toolTip": "Brush Tool",
144 "cursor": "url('images/tools/brush_down.png'), default", 144 "cursor": "url('images/tools/brush_down.png') 9 17, default",
145 "lastInGroup": false, 145 "lastInGroup": false,
146 "container": false, 146 "container": false,
147 "selected": false 147 "selected": false
diff --git a/js/document/html-document.js b/js/document/html-document.js
index 826a59c0..5d507476 100755
--- a/js/document/html-document.js
+++ b/js/document/html-document.js
@@ -647,9 +647,10 @@ exports.HTMLDocument = Montage.create(TextDocument, {
647 enumerable: false, 647 enumerable: false,
648 value: function () { 648 value: function () {
649 //TODO: Add logic to handle save before preview 649 //TODO: Add logic to handle save before preview
650 this.saveAll(); 650 this.application.ninja.documentController.handleExecuteSaveAll(null);
651 //Launching 'blank' tab for testing movie 651 //Launching 'blank' tab for testing movie
652 chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]}); 652 window.open(this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]);
653 //chrome.tabs.create({url: this.application.ninja.coreIoApi.rootUrl+this.application.ninja.documentController._activeDocument.uri.split(this.application.ninja.coreIoApi.cloudData.root)[1]});
653 } 654 }
654 }, 655 },
655 //////////////////////////////////////////////////////////////////// 656 ////////////////////////////////////////////////////////////////////
diff --git a/js/helper-classes/3D/snap-manager.js b/js/helper-classes/3D/snap-manager.js
index 94202dc5..372be345 100755
--- a/js/helper-classes/3D/snap-manager.js
+++ b/js/helper-classes/3D/snap-manager.js
@@ -597,7 +597,8 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
597 } 597 }
598 598
599 // TODO - Don't traverse components' children 599 // TODO - Don't traverse components' children
600 if(elt.elementModel && elt.elementModel.isComponent) 600// if(elt.elementModel && elt.elementModel.isComponent)
601 if(elt.nodeName.toLowerCase() === "svg" || (elt.elementModel && (elt.elementModel.isComponent || (elt.elementModel.selection === "SVG"))))
601 { 602 {
602 return; 603 return;
603 } 604 }
@@ -1007,7 +1008,8 @@ var SnapManager = exports.SnapManager = Montage.create(Component, {
1007 } 1008 }
1008 1009
1009 // TODO - Don't traverse components' children 1010 // TODO - Don't traverse components' children
1010 if(elt.elementModel && elt.elementModel.isComponent) 1011// if(elt.elementModel && elt.elementModel.isComponent)
1012 if(elt.nodeName.toLowerCase() === "svg" || (elt.elementModel && (elt.elementModel.isComponent || (elt.elementModel.selection === "SVG"))))
1011 { 1013 {
1012 return; 1014 return;
1013