aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorJonathan Duran2012-02-29 13:23:30 -0800
committerJonathan Duran2012-02-29 13:23:30 -0800
commit59757653a5c49ac0db45c5d4f93e3493c1f08e44 (patch)
tree8193046c6b1dddaedfd59d954e862a734bfb0a93 /js
parent681d55a9cdc4e790d9e1742dc13ce62e42b6a516 (diff)
downloadninja-59757653a5c49ac0db45c5d4f93e3493c1f08e44.tar.gz
Squashed commit of the following:
commit 2b9f63089534356607ad7e0ddde6f22e42d04f80 Merge: 98d491f a89e30a Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Feb 29 12:12:11 2012 -0800 Merge pull request #88 from mqg734/ToolFixes Fix for performance issue when moving shapes. commit 98d491f7e57ff5a9b091e332d7d1e81061e39efa Merge: 052d980 d417b33 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Feb 29 12:10:57 2012 -0800 Merge branch 'SnapManagerFixes' of https://github.com/mqg734/ninja-internal into integration-candidate commit 052d9805a6f0a3a90d6849eb94eabffb7ec26962 Merge: 3d233f2 2f3e4d1 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Feb 29 12:10:03 2012 -0800 Merge branch 'integration-candidate' of github.com:Motorola-Mobility/ninja-internal into integration-candidate commit 3d233f25cff057fff5c5a75e4c4b40e88c22a8f5 Merge: 3dbe798 209e078 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Feb 29 12:09:43 2012 -0800 Merge branch 'NiveshColor' of https://github.com/mqg734/ninja-internal into integration-candidate commit 2f3e4d12aa15077d3cc9794862156e57b7815e68 Merge: 850f3a1 0996a51 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Feb 29 12:06:21 2012 -0800 Merge pull request #87 from joseeight/FileIO-Build-Candidate Fixes to preview caching issues commit 850f3a1f7ab81ec80b6de1c49f2d2bbcbfe87c8e Merge: 1568367 5f777eb Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Feb 29 12:05:48 2012 -0800 Merge pull request #86 from imix23ways/Timeline Timeline commit 1568367213e760463f3ee29a531aa345fda6bd6d Merge: 3dbe798 271a8f2 Author: Valerio Virgillito <valerio@motorola.com> Date: Wed Feb 29 12:03:23 2012 -0800 Merge pull request #85 from pushkarjoshi/brushtool Brushtool commit a89e30ab834a48be32b6122e0c8ac1e0c3ed43e8 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Wed Feb 29 11:58:28 2012 -0800 Fix for performance issue when moving shapes. We don't need to call render except if the geometry and materials change. This is more easy to see with shapes like the brush tool. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit 271a8f2b29d87d12c81d03e3f1e2c05b816a138d Author: Pushkar Joshi <pushkar@motorola.com> Date: Wed Feb 29 11:50:41 2012 -0800 prevent extremely long path rendering (temporary fix) commit 0996a519afccbed526912807c70c20d598e9cae7 Merge: 98f1cfc 03d277d Author: Jose Antonio Marquez <kgq387@motorola.com> Date: Wed Feb 29 11:46:59 2012 -0800 Merge branch 'refs/heads/FileIO' into FileIO-Build-Candidate commit 03d277db80b6cea9a25320c0575ae2bf7a6d7e6e Author: Jose Antonio Marquez <kgq387@motorola.com> Date: Wed Feb 29 11:46:44 2012 -0800 Preview Fix Adding save all logic before preview, temporary fix. commit 46fb52be241dced940d46629c809a09c86ed4438 Author: Pushkar Joshi <pushkar@motorola.com> Date: Wed Feb 29 11:38:33 2012 -0800 changed the registration point of the brush tool icon and added a temporary check to prevent extremely long brush strokes commit 98f1cfc58f545702a18166ab216362d667c18915 Merge: da83f44 bb3e42b Author: Jose Antonio Marquez <kgq387@motorola.com> Date: Wed Feb 29 11:29:09 2012 -0800 Merge branch 'refs/heads/FileIO' into FileIO-Build-Candidate commit bb3e42b531848b400670df6caf0f3ce02adf1243 Author: Jose Antonio Marquez <kgq387@motorola.com> Date: Wed Feb 29 11:28:58 2012 -0800 Fix: Caching issue with chrome tab API Using window.open to test movie. commit f000a3cced9adbfff1d7aa641e6eb42ad6edf7e8 Author: Pushkar Joshi <pushkar@motorola.com> Date: Wed Feb 29 10:21:06 2012 -0800 change in comment only commit 795329d2225ff3b760f7f0ea3bb6b5e68f6c6b5b Author: Jose Antonio Marquez <kgq387@motorola.com> Date: Wed Feb 29 10:07:53 2012 -0800 Making class level url template variable Created a class level variable for the URL to be parsed out of the user files. commit f931c48a7d0bcf1222cf05787e3294839ed0b9fb Author: Pushkar Joshi <pushkar@motorola.com> Date: Wed Feb 29 09:47:41 2012 -0800 resample the brush stroke so we don't have gaps if the path is drawn rapidly, and, allow to change the stroke color, and, more efficient stroke rendering by drawing translated radial gradients (instead of creating new gradients for each stroke sample) commit d417b3315f1aa6dd52fea10cbf5f17a213ef8726 Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Wed Feb 29 06:50:51 2012 -0800 SnapManager fixes for sag tags. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit 209e0781e926212bbaaad9e8ca4b61a0c389b30f Author: Nivesh Rajbhandari <mqg734@motorola.com> Date: Tue Feb 28 17:19:42 2012 -0800 We need to remove color buttons from the color model when updating the PI for selection change. Signed-off-by: Nivesh Rajbhandari <mqg734@motorola.com> commit b43efdcbfa671a46d1edaeb1555f508fe2ad0338 Merge: 16d6a90 f2ab699 Author: Pushkar Joshi <pushkar@motorola.com> Date: Tue Feb 28 14:55:08 2012 -0800 Merge branch 'pentool' into brushtool commit 16d6a90579cdafede931a9c818689fad2e622d8b Merge: 03ca7a5 63307c9 Author: Pushkar Joshi <pushkar@motorola.com> Date: Tue Feb 28 14:19:25 2012 -0800 Merge branch 'pentool' into brushtool commit 03ca7a5ed13c25faaa9100bb666e062fd15335e6 Merge: fcb12cc 053fc63 Author: Pushkar Joshi <pushkar@motorola.com> Date: Fri Feb 24 12:08:49 2012 -0800 Merge branch 'pentool' into brushtool Conflicts: imports/codemirror/mode/scheme/scheme.js js/tools/BrushTool.js commit fcb12cc09eb3cd3b42bd215877ba18f449275b75 Author: Pushkar Joshi <pushkar@motorola.com> Date: Fri Feb 10 14:16:56 2012 -0800 render the brush stroke as a sequence of rectangles, with each rectangle having its own linear gradient commit 6bb00e69713bd7131b2bc0a15e4e0cb6071d616c Merge: 5f42bd1 666ae3e Author: Pushkar Joshi <pushkar@motorola.com> Date: Thu Feb 9 13:42:59 2012 -0800 Merge branch 'master' into brushtool commit 5f42bd1f7723483d374cdd3fe51ef8298c86a1a2 Merge: abeb9f1 fba39db Author: Pushkar Joshi <pushkar@motorola.com> Date: Thu Feb 9 10:55:58 2012 -0800 Merge branch 'pentool' into brushtool commit abeb9f1e23679200bb2f4a3ccbcebfb37645975c Author: Pushkar Joshi <pushkar@motorola.com> Date: Thu Feb 9 10:45:50 2012 -0800 first phase of simple resampling to prevent tiny segments Signed-off-by: Jonathan Duran <jduran@motorola.com>
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 ////////////////////////////////////////////////////////////////////