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 From a75947d69f571d723552f926f94d195514a01cbd Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Tue, 12 Jun 2012 23:04:07 -0700 Subject: fixed document switching issues Signed-off-by: Valerio Virgillito --- js/tools/SelectionTool.js | 1 + 1 file changed, 1 insertion(+) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index 493f4aa2..8b644d4a 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -228,6 +228,7 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { } else { this.application.ninja.currentDocument.model.domContainer = this.application.ninja.currentDocument.model.documentRoot; } + this.application.ninja.selectionController.executeSelectElement(); } }, -- cgit v1.2.3 From 75df16b937bb420e7d93a411e73f7b59578b1b7e Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Wed, 13 Jun 2012 13:41:12 -0700 Subject: fix bug #1718 (trying to delete a non-existent canvas) --- js/tools/PenTool.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'js/tools') diff --git a/js/tools/PenTool.js b/js/tools/PenTool.js index 33ca5c71..2cffb44d 100755 --- a/js/tools/PenTool.js +++ b/js/tools/PenTool.js @@ -204,10 +204,12 @@ exports.PenTool = Montage.create(ShapeTool, { this.application.ninja.stage.clearDrawingCanvas();//stageManagerModule.stageManager.clearDrawingCanvas(); //undo/redo...go through ElementController and NJEvent - var els = []; - ElementController.removeElement(this._selectedSubpathCanvas); - els.push(this._selectedSubpathCanvas); - NJevent( "elementsRemoved", els ); + if (this._selectedSubpathCanvas) { + var els = []; + ElementController.removeElement(this._selectedSubpathCanvas); + els.push(this._selectedSubpathCanvas); + NJevent( "elementsRemoved", els ); + } this._selectedSubpathCanvas = null; } }, -- cgit v1.2.3 From fbd9d2492aeaef392ad59792825b8757d6c363fc Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 15 Jun 2012 15:14:34 -0700 Subject: Fixing apply 'no color' This should fix canvas and standard DOM elements including the root (body or template wrapper). --- js/tools/EyedropperTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tools') diff --git a/js/tools/EyedropperTool.js b/js/tools/EyedropperTool.js index 6a56004d..30a6a48b 100755 --- a/js/tools/EyedropperTool.js +++ b/js/tools/EyedropperTool.js @@ -240,7 +240,7 @@ exports.EyedropperTool = Montage.create(toolBase, { else { this.application.ninja.colorController.colorModel.alpha = {value: 1, wasSetByCode: true, type: eventType}; - this.application.ninja.colorController.colorModel.applyNoColor(); + this.application.ninja.colorController.colorModel.applyNoColor(true); if(updateColorToolBar) { this._previousColor = "none"; -- cgit v1.2.3