aboutsummaryrefslogtreecommitdiff
path: root/js/tools/InkBottleTool.js
diff options
context:
space:
mode:
authorhwc4872012-04-19 13:01:43 -0700
committerhwc4872012-04-19 13:01:43 -0700
commite6a20fe64574763483dc602bd759278ccf5e5e68 (patch)
tree69defe7200206f0257fe90697136fadef59d521e /js/tools/InkBottleTool.js
parentae7eb87564632ce7c676bd728b8ff2710ff0bb83 (diff)
parent9284c19f076dec3b47ece7dc7bcd22d74e4246c3 (diff)
downloadninja-e6a20fe64574763483dc602bd759278ccf5e5e68.tar.gz
Merge branch 'master' of github.com:Motorola-Mobility/ninja-internal into Textures
Conflicts: js/lib/drawing/world.js js/lib/geom/geom-obj.js js/lib/rdge/materials/cloud-material.js js/lib/rdge/materials/deform-material.js js/lib/rdge/materials/flat-material.js js/lib/rdge/materials/material.js js/lib/rdge/materials/pulse-material.js js/lib/rdge/materials/relief-tunnel-material.js js/lib/rdge/materials/square-tunnel-material.js js/lib/rdge/materials/star-material.js js/lib/rdge/materials/taper-material.js js/lib/rdge/materials/tunnel-material.js js/lib/rdge/materials/twist-material.js js/lib/rdge/materials/twist-vert-material.js js/lib/rdge/materials/uber-material.js js/lib/rdge/materials/water-material.js js/lib/rdge/materials/z-invert-material.js
Diffstat (limited to 'js/tools/InkBottleTool.js')
-rwxr-xr-xjs/tools/InkBottleTool.js21
1 files changed, 20 insertions, 1 deletions
diff --git a/js/tools/InkBottleTool.js b/js/tools/InkBottleTool.js
index 8340ef50..95c2e71d 100755
--- a/js/tools/InkBottleTool.js
+++ b/js/tools/InkBottleTool.js
@@ -11,11 +11,12 @@ var Montage = require("montage/core/core").Montage,
11exports.InkBottleTool = Montage.create(ModifierToolBase, { 11exports.InkBottleTool = Montage.create(ModifierToolBase, {
12 _canSnap: { value: false }, 12 _canSnap: { value: false },
13 _canColor: { value: true }, 13 _canColor: { value: true },
14 _targetedElement: { value: null },
14 15
15 HandleMouseMove: { 16 HandleMouseMove: {
16 value : function (event) 17 value : function (event)
17 { 18 {
18 var obj = this.application.ninja.stage.GetElement(event); 19 var obj = this.application.ninja.stage.GetSelectableElement(event);
19 var cursor = "url('images/cursors/ink.png') 6 11, default"; 20 var cursor = "url('images/cursors/ink.png') 6 11, default";
20 var canColor = true; 21 var canColor = true;
21 if (obj) 22 if (obj)
@@ -25,7 +26,25 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, {
25 { 26 {
26 cursor = "url('images/cursors/ink_no.png') 6 11, default"; 27 cursor = "url('images/cursors/ink_no.png') 6 11, default";
27 canColor = false; 28 canColor = false;
29 if(this._targetedElement)
30 {
31 this._targetedElement.classList.remove("active-element-outline");
32 this._targetedElement = null;
33 }
28 } 34 }
35 else
36 {
37 if (obj !== this._targetedElement)
38 {
39 if(this._targetedElement)
40 {
41 this._targetedElement.classList.remove("active-element-outline");
42 }
43 }
44 this._targetedElement = obj;
45 this._targetedElement.classList.add("active-element-outline");
46 }
47
29 } 48 }
30 this.application.ninja.stage.drawingCanvas.style.cursor = cursor; 49 this.application.ninja.stage.drawingCanvas.style.cursor = cursor;
31 this._canColor = canColor; 50 this._canColor = canColor;