From 1b68bb87c458877cb850a96d8a093d6064bc41dc Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Fri, 2 Mar 2012 12:23:44 -0800 Subject: Catmull-Rom spline sampling for the brush stroke, and options for stroke size, stroke hardness and both stroke colors (left and right --- temporarily using the stroke and fill colors respectively) --- .../brush-properties.reel/brush-properties.js | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) (limited to 'js/components/tools-properties/brush-properties.reel/brush-properties.js') diff --git a/js/components/tools-properties/brush-properties.reel/brush-properties.js b/js/components/tools-properties/brush-properties.reel/brush-properties.js index 92da98cc..d2fcf888 100755 --- a/js/components/tools-properties/brush-properties.reel/brush-properties.js +++ b/js/components/tools-properties/brush-properties.reel/brush-properties.js @@ -9,17 +9,10 @@ var Component = require("montage/ui/component").Component; var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties; exports.BrushProperties = Montage.create(ToolProperties, { - - - _subPrepare: { - value: function() { - //this.divElement.addEventListener("click", this, false); - } + strokeSize: { + get: function() { return this._strokeSize; } }, - - handleClick: { - value: function(event) { - // this.selectedElement = event._event.target.id; - } + strokeHardness: { + get: function() { return this._strokeHardness; } } -}); \ No newline at end of file +}); -- cgit v1.2.3 From 703fb3d06e88257ac73c1d1a0ec6ca33a64f4371 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Wed, 7 Mar 2012 14:33:21 -0800 Subject: implement stroke hardness such that it is percentage of the stroke width that's fully the color of the brush AND add a smoothing flag for the brush options --- .../tools-properties/brush-properties.reel/brush-properties.js | 3 +++ 1 file changed, 3 insertions(+) (limited to 'js/components/tools-properties/brush-properties.reel/brush-properties.js') diff --git a/js/components/tools-properties/brush-properties.reel/brush-properties.js b/js/components/tools-properties/brush-properties.reel/brush-properties.js index d2fcf888..0ce685b5 100755 --- a/js/components/tools-properties/brush-properties.reel/brush-properties.js +++ b/js/components/tools-properties/brush-properties.reel/brush-properties.js @@ -14,5 +14,8 @@ exports.BrushProperties = Montage.create(ToolProperties, { }, strokeHardness: { get: function() { return this._strokeHardness; } + }, + doSmoothing:{ + get: function() {return this._doSmoothing; } } }); -- cgit v1.2.3 From fcab2a14f8de302948d38f55db41e2c1c92baa34 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Thu, 8 Mar 2012 16:03:17 -0800 Subject: brush stroke options for calligraphic brush style --- .../tools-properties/brush-properties.reel/brush-properties.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'js/components/tools-properties/brush-properties.reel/brush-properties.js') diff --git a/js/components/tools-properties/brush-properties.reel/brush-properties.js b/js/components/tools-properties/brush-properties.reel/brush-properties.js index 0ce685b5..e6faa0f0 100755 --- a/js/components/tools-properties/brush-properties.reel/brush-properties.js +++ b/js/components/tools-properties/brush-properties.reel/brush-properties.js @@ -16,6 +16,12 @@ exports.BrushProperties = Montage.create(ToolProperties, { get: function() { return this._strokeHardness; } }, doSmoothing:{ - get: function() {return this._doSmoothing; } + get: function() {return this._doSmoothing.checked; } + }, + useCalligraphic: { + get: function() {return this._useCalligraphic.checked;} + }, + strokeAngle: { + get: function() {return this._strokeAngle;} } }); -- cgit v1.2.3 From 76f2021618c0a6a99a1b855233e353e84ca99467 Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 13 Mar 2012 11:23:32 -0700 Subject: Add a smoothing amount parameter, and hide options based on checkboxes --- .../brush-properties.reel/brush-properties.js | 30 ++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'js/components/tools-properties/brush-properties.reel/brush-properties.js') diff --git a/js/components/tools-properties/brush-properties.reel/brush-properties.js b/js/components/tools-properties/brush-properties.reel/brush-properties.js index e6faa0f0..fdcd50f8 100755 --- a/js/components/tools-properties/brush-properties.reel/brush-properties.js +++ b/js/components/tools-properties/brush-properties.reel/brush-properties.js @@ -9,6 +9,33 @@ var Component = require("montage/ui/component").Component; var ToolProperties = require("js/components/tools-properties/tool-properties").ToolProperties; exports.BrushProperties = Montage.create(ToolProperties, { + _subPrepare: { + value: function() { + this.handleChange(null); + this._useCalligraphic.addEventListener("change", this, false); + this._doSmoothing.addEventListener("change", this, false); + } + }, + handleChange: { + value: function(event) { + if(this._useCalligraphic.checked) { + this._strokeAngle.element.style["display"] = ""; + this._strokeAngle.visible = true; + this._angleLabel.style["display"] = ""; + } else { + this._strokeAngle.element.style["display"] = "none"; + this._strokeAngle.visible = false; + this._angleLabel.style["display"] = "none"; + } + if(this._doSmoothing.checked) { + this._smoothingAmount.element.style["display"] = ""; + this._smoothingAmount.visible = true; + } else { + this._smoothingAmount.element.style["display"] = "none"; + this._smoothingAmount.visible = false; + } + } + }, strokeSize: { get: function() { return this._strokeSize; } }, @@ -18,6 +45,9 @@ exports.BrushProperties = Montage.create(ToolProperties, { doSmoothing:{ get: function() {return this._doSmoothing.checked; } }, + smoothingAmount:{ + get: function() {return this._smoothingAmount;} + }, useCalligraphic: { get: function() {return this._useCalligraphic.checked;} }, -- cgit v1.2.3