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/FillTool.js | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'js/tools/FillTool.js') diff --git a/js/tools/FillTool.js b/js/tools/FillTool.js index 4b07ae83..746f20cf 100755 --- a/js/tools/FillTool.js +++ b/js/tools/FillTool.js @@ -17,11 +17,12 @@ var Montage = require("montage/core/core").Montage, exports.FillTool = 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/fill.png') 14 14, default"; var canColor = true; if (obj) @@ -31,6 +32,23 @@ exports.FillTool = Montage.create(ModifierToolBase, { { cursor = "url('images/cursors/nofill.png') 14 14, 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; -- cgit v1.2.3