diff options
author | Valerio Virgillito | 2012-02-16 21:49:35 -0800 |
---|---|---|
committer | Valerio Virgillito | 2012-02-16 21:49:35 -0800 |
commit | 9f0c4efe2ed9a00f2c5d85c9d88a8040fedb5d8f (patch) | |
tree | 19aa9599e0cc37a126df9d61f7e6f6d4baaae75d /js/tools | |
parent | 09f3c65dcbb4d21b75b7fe591c52cb9b9750bf3f (diff) | |
parent | e0bead5a36ae987c558607b77745c4018caf59f8 (diff) | |
download | ninja-9f0c4efe2ed9a00f2c5d85c9d88a8040fedb5d8f.tar.gz |
Merge pull request #50 from mencio/canvas-data
Adding canvas data attributes
Diffstat (limited to 'js/tools')
-rwxr-xr-x | js/tools/BrushTool.js | 2 | ||||
-rwxr-xr-x | js/tools/LineTool.js | 2 | ||||
-rwxr-xr-x | js/tools/PenTool.js | 2 | ||||
-rwxr-xr-x | js/tools/ShapeTool.js | 2 |
4 files changed, 4 insertions, 4 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js index ce8ffbb9..4d44326f 100755 --- a/js/tools/BrushTool.js +++ b/js/tools/BrushTool.js | |||
@@ -201,7 +201,7 @@ exports.BrushTool = Montage.create(ShapeTool, { | |||
201 | var top = Math.round(midPt[1] - 0.5 * h); | 201 | var top = Math.round(midPt[1] - 0.5 * h); |
202 | 202 | ||
203 | if (!canvas) { | 203 | if (!canvas) { |
204 | var newCanvas = NJUtils.makeNJElement("canvas", "Brushstroke", "shape", null, true); | 204 | var newCanvas = NJUtils.makeNJElement("canvas", "Brushstroke", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); |
205 | var elementModel = TagTool.makeElement(w, h, planeMat, midPt, newCanvas); | 205 | var elementModel = TagTool.makeElement(w, h, planeMat, midPt, newCanvas); |
206 | ElementMediator.addElement(newCanvas, elementModel.data, true); | 206 | ElementMediator.addElement(newCanvas, elementModel.data, true); |
207 | 207 | ||
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index 99c374a7..233316a5 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js | |||
@@ -82,7 +82,7 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
82 | h += ~~(yAdj*2); | 82 | h += ~~(yAdj*2); |
83 | } | 83 | } |
84 | 84 | ||
85 | canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", null, true); | 85 | canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); |
86 | var elementModel = TagTool.makeElement(w, h, drawData.planeMat, drawData.midPt, canvas); | 86 | var elementModel = TagTool.makeElement(w, h, drawData.planeMat, drawData.midPt, canvas); |
87 | 87 | ||
88 | ElementMediator.addElement(canvas, elementModel.data, true); | 88 | ElementMediator.addElement(canvas, elementModel.data, true); |
diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 9a69b53d..7749d525 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js | |||
@@ -570,7 +570,7 @@ exports.PenTool = Montage.create(ShapeTool, { | |||
570 | 570 | ||
571 | if (!canvas) { | 571 | if (!canvas) { |
572 | var newCanvas = null; | 572 | var newCanvas = null; |
573 | newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", null, true); | 573 | newCanvas = NJUtils.makeNJElement("canvas", "Subpath", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); |
574 | var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas); | 574 | var elementModel = TagTool.makeElement(parseInt(w), parseInt(h), planeMat, midPt, newCanvas); |
575 | ElementMediator.addElement(newCanvas, elementModel.data, true); | 575 | ElementMediator.addElement(newCanvas, elementModel.data, true); |
576 | 576 | ||
diff --git a/js/tools/ShapeTool.js b/js/tools/ShapeTool.js index 4ccb7a8d..29e9b99f 100755 --- a/js/tools/ShapeTool.js +++ b/js/tools/ShapeTool.js | |||
@@ -66,7 +66,7 @@ exports.ShapeTool = Montage.create(DrawingTool, { | |||
66 | var canvas; | 66 | var canvas; |
67 | if(!this._useExistingCanvas()) | 67 | if(!this._useExistingCanvas()) |
68 | { | 68 | { |
69 | canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", null, true); | 69 | canvas = NJUtils.makeNJElement("canvas", "Canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); |
70 | var elementModel = TagTool.makeElement(~~drawData.width, ~~drawData.height, | 70 | var elementModel = TagTool.makeElement(~~drawData.width, ~~drawData.height, |
71 | drawData.planeMat, drawData.midPt, canvas); | 71 | drawData.planeMat, drawData.midPt, canvas); |
72 | 72 | ||