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 ad6f78493295c9c7b4c11cd6a895dd5cc8e207f7 Mon Sep 17 00:00:00 2001 From: Valerio Virgillito Date: Sun, 17 Jun 2012 22:58:26 -0700 Subject: updating the components and descriptor.json to support montage v.11 Signed-off-by: Valerio Virgillito --- js/tools/TextTool.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'js/tools') diff --git a/js/tools/TextTool.js b/js/tools/TextTool.js index 024a92ce..0aef6c1c 100755 --- a/js/tools/TextTool.js +++ b/js/tools/TextTool.js @@ -6,7 +6,7 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot var Montage = require("montage/core/core").Montage, DrawingTool = require("js/tools/drawing-tool").DrawingTool, - RichTextEditor = require("node_modules/labs/rich-text-editor.reel").RichTextEditor, + //RichTextEditor = ("node_modules/labs/rich-text-editor.reel").RichTextEditor, ElementsMediator = require("js/mediators/element-mediator").ElementMediator; exports.TextTool = Montage.create(DrawingTool, { -- cgit v1.2.3 From a0d18963d746e410511c29edd32bc1775d2d5851 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 19 Jun 2012 15:42:31 -0700 Subject: IKNINJA-1519 - Transform tool does not transform objects correctly in 3D space or in Top/Side view. Signed-off-by: Nivesh Rajbhandari --- js/tools/SelectionTool.js | 7 ++----- js/tools/ToolBase.js | 2 ++ js/tools/drawing-tool-base.js | 11 +++++++++-- js/tools/modifier-tool-base.js | 17 ++++++++--------- 4 files changed, 21 insertions(+), 16 deletions(-) (limited to 'js/tools') diff --git a/js/tools/SelectionTool.js b/js/tools/SelectionTool.js index 8b644d4a..9bd885a4 100755 --- a/js/tools/SelectionTool.js +++ b/js/tools/SelectionTool.js @@ -583,11 +583,8 @@ var SelectionTool = exports.SelectionTool = Montage.create(ModifierToolBase, { this.mouseUpHitRec = DrawingToolBase.getUpdatedSnapPoint(point.x, point.y, do3DSnap, this.mouseDownHitRec); if (this._mouseDownHitRec && this._mouseUpHitRec) { - data = this.getDrawingData(event); - if(data) - { - this.modifyElements({pt0:data.mouseDownPos, pt1:data.mouseUpPos}, event); - } + this.modifyElements({pt0:this._mouseDownHitRec.calculateElementScreenPoint(), + pt1:this._mouseUpHitRec.calculateElementScreenPoint()}, event); } } } diff --git a/js/tools/ToolBase.js b/js/tools/ToolBase.js index f43b1b58..88333c74 100755 --- a/js/tools/ToolBase.js +++ b/js/tools/ToolBase.js @@ -35,6 +35,8 @@ exports.toolBase = Montage.create(Component, { _currentX: {value: 0, writable: true}, _currentY: {value: 0, writable: true}, + _dragPlane: { value: null }, + /** * This function is for specifying custom feedback routine * upon mouse over. diff --git a/js/tools/drawing-tool-base.js b/js/tools/drawing-tool-base.js index a752ad65..b5416a65 100755 --- a/js/tools/drawing-tool-base.js +++ b/js/tools/drawing-tool-base.js @@ -14,9 +14,16 @@ var drawUtils = require("js/helper-classes/3D/draw-utils").DrawUtils; exports.DrawingToolBase = Montage.create(Component, { - dragPlane: { - value: null + dragPlane: + { + get: function () { + return this.application.ninja.toolsData.selectedToolInstance._dragPlane; + }, + set: function (value) { + this.application.ninja.toolsData.selectedToolInstance._dragPlane = value; + } }, + /** * Used on the initial MouseDown for Drawing Tools * diff --git a/js/tools/modifier-tool-base.js b/js/tools/modifier-tool-base.js index 6c569f0a..14a7e619 100755 --- a/js/tools/modifier-tool-base.js +++ b/js/tools/modifier-tool-base.js @@ -21,7 +21,6 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { //------------------------------------------------------------------------- // Snapping-specific properties _canSnap: { value: true }, - _dragPlane: { value: null }, _snapParam: { value: null }, _snapIndex: { value: -1 }, _useQuadPt: { value: false }, @@ -163,15 +162,15 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { if(!this._dragPlane) { -// if( this._inLocalMode && (this._startMatArray.length === 1) ) -// { -// this._dragPlane = viewUtils.getUnprojectedElementPlane(this._clickedObject); -// snapManager.setupDragPlaneFromPlane(this._dragPlane); -// } -// else -// { + if((this._handleMode !== null) && (this.application.ninja.toolsData.selectedTool.action === "SelectionTool")) + { + this._dragPlane = viewUtils.getUnprojectedElementPlane(this.application.ninja.selectedElements[0]); + snapManager.setupDragPlaneFromPlane(this._dragPlane); + } + else + { this._dragPlane = snapManager.setupDragPlanes( hitRec, true ); -// } + } } // only do quadrant snapping if the 4 corners of the element are in the drag plane -- cgit v1.2.3