From 8eac5582b72115969a9f915f4303535c22018033 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 2 May 2012 17:00:12 -0700 Subject: Material editor --- js/tools/TagTool.js | 2 ++ 1 file changed, 2 insertions(+) (limited to 'js/tools') diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js index d946db72..807d5139 100755 --- a/js/tools/TagTool.js +++ b/js/tools/TagTool.js @@ -157,6 +157,8 @@ exports.TagTool = Montage.create(DrawingTool, { selectedTag = this.options.selectedElement; + if (!NJUtils) NJUtils = require("js/lib/NJUtils").NJUtils; + if(selectedTag === "divTool") { newTag = NJUtils.makeNJElement("div", "div", "block"); } else if(selectedTag === "imageTool") { -- cgit v1.2.3 From 20c0d7c1b6e7544da2aee3ade08b73883cd458c1 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 3 May 2012 09:42:08 -0700 Subject: Updated hard-coded linear and radial gradients to use the color values in Linear/RadialGradientMaterials. Signed-off-by: Nivesh Rajbhandari --- js/tools/LineTool.js | 2 +- js/tools/OvalTool.js | 4 ++-- js/tools/RectTool.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'js/tools') diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index 3e9167fd..61971c33 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js @@ -225,7 +225,7 @@ exports.LineTool = Montage.create(ShapeTool, { { strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); } - strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; + strokeColor = ShapesController.getMaterialColor(strokeMaterial) || strokeColor; } var world = this.getGLWorld(canvas, this.options.use3D); diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index 6edec811..f06fadb9 100755 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js @@ -53,14 +53,14 @@ exports.OvalTool = Montage.create(ShapeTool, { { strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); } - strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; + strokeColor = ShapesController.getMaterialColor(strokeMaterial) || strokeColor; var fillM = this.options.fillMaterial; if(fillM) { fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); } - fillColor = ShapesController.getMaterialColor(fillM) || fillColor; + fillColor = ShapesController.getMaterialColor(fillMaterial) || fillColor; } var world = this.getGLWorld(canvas, this.options.use3D); diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js index 0c14a559..5865f00d 100755 --- a/js/tools/RectTool.js +++ b/js/tools/RectTool.js @@ -72,14 +72,14 @@ exports.RectTool = Montage.create(ShapeTool, { { strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); } - strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; + strokeColor = ShapesController.getMaterialColor(strokeMaterial) || strokeColor; var fillM = this.options.fillMaterial; if(fillM) { fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); } - fillColor = ShapesController.getMaterialColor(fillM) || fillColor; + fillColor = ShapesController.getMaterialColor(fillMaterial) || fillColor; } var world = this.getGLWorld(canvas, this.options.use3D); -- cgit v1.2.3 From 5fcb96cae89007c684df3ce948831e2fcf9fd8b7 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Mon, 14 May 2012 10:00:52 -0700 Subject: Fixing merge issues --- js/tools/LineTool.js | 2 +- js/tools/OvalTool.js | 4 ++-- js/tools/RectTool.js | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'js/tools') diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index 6621d18b..d5bfa38a 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js @@ -226,7 +226,7 @@ exports.LineTool = Montage.create(ShapeTool, { { strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); } - strokeColor = ShapesController.getMaterialColor(strokeMaterial) || strokeColor; + strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; } var world = this.getGLWorld(canvas, this.options.use3D); diff --git a/js/tools/OvalTool.js b/js/tools/OvalTool.js index 917da538..e9dc66bb 100755 --- a/js/tools/OvalTool.js +++ b/js/tools/OvalTool.js @@ -53,14 +53,14 @@ exports.OvalTool = Montage.create(ShapeTool, { { strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); } - strokeColor = ShapesController.getMaterialColor(strokeMaterial) || strokeColor; + strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; var fillM = this.options.fillMaterial; if(fillM) { fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); } - fillColor = ShapesController.getMaterialColor(fillMaterial) || fillColor; + fillColor = ShapesController.getMaterialColor(fillM) || fillColor; } var world = this.getGLWorld(canvas, this.options.use3D); diff --git a/js/tools/RectTool.js b/js/tools/RectTool.js index a8c57688..0a3c8200 100755 --- a/js/tools/RectTool.js +++ b/js/tools/RectTool.js @@ -72,14 +72,14 @@ exports.RectTool = Montage.create(ShapeTool, { { strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); } - strokeColor = ShapesController.getMaterialColor(strokeMaterial) || strokeColor; + strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; var fillM = this.options.fillMaterial; if(fillM) { fillMaterial = Object.create(MaterialsModel.getMaterial(fillM)); } - fillColor = ShapesController.getMaterialColor(fillMaterial) || fillColor; + fillColor = ShapesController.getMaterialColor(fillM) || fillColor; } var world = this.getGLWorld(canvas, this.options.use3D); -- cgit v1.2.3 From ba4e58f11d8028375365ae0ddd0d3f601c7f64ca Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 12 Jun 2012 16:58:25 -0700 Subject: Removed references to NJUtils --- js/tools/TagTool.js | 1 - 1 file changed, 1 deletion(-) (limited to 'js/tools') diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js index 3b1cd063..fac6798f 100755 --- a/js/tools/TagTool.js +++ b/js/tools/TagTool.js @@ -86,7 +86,6 @@ exports.TagTool = Montage.create(DrawingTool, { // Create the element if(this.options.selectedElement === "custom") { element = document.application.njUtils.make(this.options.customName.value, null, this.application.ninja.currentDocument); - if (!NJUtils) NJUtils = require("js/lib/NJUtils").NJUtils; } else { element = document.application.njUtils.make(this.options.selectedElement, null, this.application.ninja.currentDocument); -- cgit v1.2.3