From 4d132fcbde4540c2cac6c0df613940353e2690f6 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Tue, 3 Apr 2012 12:03:16 -0700 Subject: Give user feedback about which element the Fill/InkBottle tools will act on. Signed-off-by: Nivesh Rajbhandari --- js/tools/InkBottleTool.js | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'js/tools/InkBottleTool.js') 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, exports.InkBottleTool = Montage.create(ModifierToolBase, { _canSnap: { value: false }, _canColor: { value: true }, + _targetedElement: { value: null }, HandleMouseMove: { value : function (event) { - var obj = this.application.ninja.stage.GetElement(event); + var obj = this.application.ninja.stage.GetSelectableElement(event); var cursor = "url('images/cursors/ink.png') 6 11, default"; var canColor = true; if (obj) @@ -25,7 +26,25 @@ exports.InkBottleTool = Montage.create(ModifierToolBase, { { cursor = "url('images/cursors/ink_no.png') 6 11, default"; canColor = false; + if(this._targetedElement) + { + this._targetedElement.classList.remove("active-element-outline"); + this._targetedElement = null; + } } + else + { + if (obj !== this._targetedElement) + { + if(this._targetedElement) + { + this._targetedElement.classList.remove("active-element-outline"); + } + } + this._targetedElement = obj; + this._targetedElement.classList.add("active-element-outline"); + } + } this.application.ninja.stage.drawingCanvas.style.cursor = cursor; this._canColor = canColor; -- cgit v1.2.3