From f4df8204a57e1bc6021b651ebb2259f9931cf26f Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 22 May 2012 13:21:32 -0700 Subject: allow changes in the pen subtool in options to be seen by the pen tool code (can now select the pen plus, pen minus subtools) AND add keyboard shortcut for brush tool --- .../pen-properties.reel/pen-properties.js | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'js/components') diff --git a/js/components/tools-properties/pen-properties.reel/pen-properties.js b/js/components/tools-properties/pen-properties.reel/pen-properties.js index cd205e07..aba6cb61 100755 --- a/js/components/tools-properties/pen-properties.reel/pen-properties.js +++ b/js/components/tools-properties/pen-properties.reel/pen-properties.js @@ -9,6 +9,17 @@ var ToolProperties = require("js/components/tools-properties/tool-properties").T var PenProperties = exports.PenProperties = Montage.create(ToolProperties, { addedColorChips: { value: false }, + _penToolRadio: { value: null, enumerable: false }, + _penPlusRadio: { value: null, enumerable: false }, + _penMinusRadio: { value: null, enumerable: false }, + + _subPrepare: { + value: function() { + this._penToolRadio.addEventListener("click", this, false); + this._penPlusRadio.addEventListener("click", this, false); + this._penMinusRadio.addEventListener("click", this, false); + } + }, _fill: { enumerable: false, @@ -50,6 +61,23 @@ var PenProperties = exports.PenProperties = Montage.create(ToolProperties, { } }, + _selectedSubtool: { + value: "pen", enumerable: false + }, + + selectedSubtool: { + get: function() { return this._selectedSubtool;}, + set: function(value) { this._selectedSubtool = value; } + }, + + handleClick: { + value: function(event) { + this._selectedSubtool = event._event.target.value; + console.log("handleClick changing pen tool subtool to "+this.selectedSubtool); + NJevent("penSubToolChange"); + } + }, + draw: { enumerable: false, value: function () { -- cgit v1.2.3 From e2ae637582b8e02125086201a64ee85761b01093 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 29 May 2012 14:24:47 -0700 Subject: More consistent local and global mouse coords which solves a bug with the Pen minus subtool not removing 1 anchor paths --- js/components/tools-properties/pen-properties.reel/pen-properties.js | 1 - 1 file changed, 1 deletion(-) (limited to 'js/components') diff --git a/js/components/tools-properties/pen-properties.reel/pen-properties.js b/js/components/tools-properties/pen-properties.reel/pen-properties.js index aba6cb61..c37359e1 100755 --- a/js/components/tools-properties/pen-properties.reel/pen-properties.js +++ b/js/components/tools-properties/pen-properties.reel/pen-properties.js @@ -73,7 +73,6 @@ var PenProperties = exports.PenProperties = Montage.create(ToolProperties, { handleClick: { value: function(event) { this._selectedSubtool = event._event.target.value; - console.log("handleClick changing pen tool subtool to "+this.selectedSubtool); NJevent("penSubToolChange"); } }, -- cgit v1.2.3