diff options
author | Eric Guzman | 2012-06-20 19:42:03 -0700 |
---|---|---|
committer | Eric Guzman | 2012-06-20 19:42:03 -0700 |
commit | 3270aac4980c908f305fb53abadda5121ff6b9cb (patch) | |
tree | 6255aaab239fde71b1f4862dd70de7be62f48b85 /js/tools | |
parent | a5d93daf6fdccbfee160d6a8ba08f6b6d4b9d7cc (diff) | |
parent | 87377c81da06abf6d656017859830a3ab2902f0e (diff) | |
download | ninja-3270aac4980c908f305fb53abadda5121ff6b9cb.tar.gz |
Merge branch 'binding' of github.com:dhg637/ninja-internal into binding
Diffstat (limited to 'js/tools')
-rwxr-xr-x | js/tools/LineTool.js | 2 | ||||
-rwxr-xr-x | js/tools/SelectionTool.js | 7 | ||||
-rwxr-xr-x | js/tools/TagTool.js | 1 | ||||
-rwxr-xr-x | js/tools/TextTool.js | 2 | ||||
-rwxr-xr-x | js/tools/ToolBase.js | 2 | ||||
-rwxr-xr-x | js/tools/drawing-tool-base.js | 11 | ||||
-rwxr-xr-x | js/tools/modifier-tool-base.js | 17 |
7 files changed, 24 insertions, 18 deletions
diff --git a/js/tools/LineTool.js b/js/tools/LineTool.js index 40475908..07429bc0 100755 --- a/js/tools/LineTool.js +++ b/js/tools/LineTool.js | |||
@@ -237,7 +237,7 @@ exports.LineTool = Montage.create(ShapeTool, { | |||
237 | { | 237 | { |
238 | strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); | 238 | strokeMaterial = Object.create(MaterialsModel.getMaterial(strokeM)); |
239 | } | 239 | } |
240 | strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; | 240 | strokeColor = ShapesController.getMaterialColor(strokeM) || strokeColor; |
241 | } | 241 | } |
242 | 242 | ||
243 | var world = this.getGLWorld(canvas, this.options.use3D); | 243 | var world = this.getGLWorld(canvas, this.options.use3D); |
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, { | |||
583 | this.mouseUpHitRec = DrawingToolBase.getUpdatedSnapPoint(point.x, point.y, do3DSnap, this.mouseDownHitRec); | 583 | this.mouseUpHitRec = DrawingToolBase.getUpdatedSnapPoint(point.x, point.y, do3DSnap, this.mouseDownHitRec); |
584 | if (this._mouseDownHitRec && this._mouseUpHitRec) | 584 | if (this._mouseDownHitRec && this._mouseUpHitRec) |
585 | { | 585 | { |
586 | data = this.getDrawingData(event); | 586 | this.modifyElements({pt0:this._mouseDownHitRec.calculateElementScreenPoint(), |
587 | if(data) | 587 | pt1:this._mouseUpHitRec.calculateElementScreenPoint()}, event); |
588 | { | ||
589 | this.modifyElements({pt0:data.mouseDownPos, pt1:data.mouseUpPos}, event); | ||
590 | } | ||
591 | } | 588 | } |
592 | } | 589 | } |
593 | } | 590 | } |
diff --git a/js/tools/TagTool.js b/js/tools/TagTool.js index 508e2a85..fac6798f 100755 --- a/js/tools/TagTool.js +++ b/js/tools/TagTool.js | |||
@@ -86,6 +86,7 @@ exports.TagTool = Montage.create(DrawingTool, { | |||
86 | // Create the element | 86 | // Create the element |
87 | if(this.options.selectedElement === "custom") { | 87 | if(this.options.selectedElement === "custom") { |
88 | element = document.application.njUtils.make(this.options.customName.value, null, this.application.ninja.currentDocument); | 88 | element = document.application.njUtils.make(this.options.customName.value, null, this.application.ninja.currentDocument); |
89 | |||
89 | } else { | 90 | } else { |
90 | element = document.application.njUtils.make(this.options.selectedElement, null, this.application.ninja.currentDocument); | 91 | element = document.application.njUtils.make(this.options.selectedElement, null, this.application.ninja.currentDocument); |
91 | } | 92 | } |
diff --git a/js/tools/TextTool.js b/js/tools/TextTool.js index cff3b6e3..7f82855b 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 | |||
6 | 6 | ||
7 | var Montage = require("montage/core/core").Montage, | 7 | var Montage = require("montage/core/core").Montage, |
8 | DrawingTool = require("js/tools/drawing-tool").DrawingTool, | 8 | DrawingTool = require("js/tools/drawing-tool").DrawingTool, |
9 | RichTextEditor = require("node_modules/labs/rich-text-editor.reel").RichTextEditor, | 9 | //RichTextEditor = ("node_modules/labs/rich-text-editor.reel").RichTextEditor, |
10 | ElementsMediator = require("js/mediators/element-mediator").ElementMediator; | 10 | ElementsMediator = require("js/mediators/element-mediator").ElementMediator; |
11 | 11 | ||
12 | exports.TextTool = Montage.create(DrawingTool, { | 12 | exports.TextTool = Montage.create(DrawingTool, { |
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, { | |||
35 | _currentX: {value: 0, writable: true}, | 35 | _currentX: {value: 0, writable: true}, |
36 | _currentY: {value: 0, writable: true}, | 36 | _currentY: {value: 0, writable: true}, |
37 | 37 | ||
38 | _dragPlane: { value: null }, | ||
39 | |||
38 | /** | 40 | /** |
39 | * This function is for specifying custom feedback routine | 41 | * This function is for specifying custom feedback routine |
40 | * upon mouse over. | 42 | * 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; | |||
14 | 14 | ||
15 | exports.DrawingToolBase = Montage.create(Component, { | 15 | exports.DrawingToolBase = Montage.create(Component, { |
16 | 16 | ||
17 | dragPlane: { | 17 | dragPlane: |
18 | value: null | 18 | { |
19 | get: function () { | ||
20 | return this.application.ninja.toolsData.selectedToolInstance._dragPlane; | ||
21 | }, | ||
22 | set: function (value) { | ||
23 | this.application.ninja.toolsData.selectedToolInstance._dragPlane = value; | ||
24 | } | ||
19 | }, | 25 | }, |
26 | |||
20 | /** | 27 | /** |
21 | * Used on the initial MouseDown for Drawing Tools | 28 | * Used on the initial MouseDown for Drawing Tools |
22 | * | 29 | * |
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, { | |||
21 | //------------------------------------------------------------------------- | 21 | //------------------------------------------------------------------------- |
22 | // Snapping-specific properties | 22 | // Snapping-specific properties |
23 | _canSnap: { value: true }, | 23 | _canSnap: { value: true }, |
24 | _dragPlane: { value: null }, | ||
25 | _snapParam: { value: null }, | 24 | _snapParam: { value: null }, |
26 | _snapIndex: { value: -1 }, | 25 | _snapIndex: { value: -1 }, |
27 | _useQuadPt: { value: false }, | 26 | _useQuadPt: { value: false }, |
@@ -163,15 +162,15 @@ exports.ModifierToolBase = Montage.create(DrawingTool, { | |||
163 | 162 | ||
164 | if(!this._dragPlane) | 163 | if(!this._dragPlane) |
165 | { | 164 | { |
166 | // if( this._inLocalMode && (this._startMatArray.length === 1) ) | 165 | if((this._handleMode !== null) && (this.application.ninja.toolsData.selectedTool.action === "SelectionTool")) |
167 | // { | 166 | { |
168 | // this._dragPlane = viewUtils.getUnprojectedElementPlane(this._clickedObject); | 167 | this._dragPlane = viewUtils.getUnprojectedElementPlane(this.application.ninja.selectedElements[0]); |
169 | // snapManager.setupDragPlaneFromPlane(this._dragPlane); | 168 | snapManager.setupDragPlaneFromPlane(this._dragPlane); |
170 | // } | 169 | } |
171 | // else | 170 | else |
172 | // { | 171 | { |
173 | this._dragPlane = snapManager.setupDragPlanes( hitRec, true ); | 172 | this._dragPlane = snapManager.setupDragPlanes( hitRec, true ); |
174 | // } | 173 | } |
175 | } | 174 | } |
176 | 175 | ||
177 | // only do quadrant snapping if the 4 corners of the element are in the drag plane | 176 | // only do quadrant snapping if the 4 corners of the element are in the drag plane |