aboutsummaryrefslogtreecommitdiff
path: root/js/tools/BrushTool.js
diff options
context:
space:
mode:
authorPushkar Joshi2012-03-13 11:23:32 -0700
committerPushkar Joshi2012-03-13 11:23:32 -0700
commit76f2021618c0a6a99a1b855233e353e84ca99467 (patch)
tree494ee3268c80a79fae97ae39cd4c1e7e9ea4b7ef /js/tools/BrushTool.js
parent730c42e005b1ebd96448e3bc2dd700ffd8909cb5 (diff)
downloadninja-76f2021618c0a6a99a1b855233e353e84ca99467.tar.gz
Add a smoothing amount parameter, and hide options based on checkboxes
Diffstat (limited to 'js/tools/BrushTool.js')
-rw-r--r--js/tools/BrushTool.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/js/tools/BrushTool.js b/js/tools/BrushTool.js
index 4ce9976a..d45d108e 100644
--- a/js/tools/BrushTool.js
+++ b/js/tools/BrushTool.js
@@ -85,7 +85,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
85 85
86 var strokeHardness = 100; 86 var strokeHardness = 100;
87 if (this.options.strokeHardness){ 87 if (this.options.strokeHardness){
88 strokeHardness = ShapesController.GetValueInPixels(this.options.strokeHardness.value, this.options.strokeHardness.units); 88 strokeHardness = this.options.strokeHardness.value;
89 } 89 }
90 this._selectedBrushStroke.setStrokeHardness(strokeHardness); 90 this._selectedBrushStroke.setStrokeHardness(strokeHardness);
91 91
@@ -94,7 +94,10 @@ exports.BrushTool = Montage.create(ShapeTool, {
94 doSmoothing = this.options.doSmoothing; 94 doSmoothing = this.options.doSmoothing;
95 } 95 }
96 this._selectedBrushStroke.setDoSmoothing(doSmoothing); 96 this._selectedBrushStroke.setDoSmoothing(doSmoothing);
97 97 if (doSmoothing){
98 this._selectedBrushStroke.setSmoothingAmount(this.options.smoothingAmount.value);
99 }
100
98 var useCalligraphic = false; 101 var useCalligraphic = false;
99 if (this.options.useCalligraphic){ 102 if (this.options.useCalligraphic){
100 useCalligraphic = this.options.useCalligraphic; 103 useCalligraphic = this.options.useCalligraphic;
@@ -103,7 +106,7 @@ exports.BrushTool = Montage.create(ShapeTool, {
103 this._selectedBrushStroke.setStrokeUseCalligraphic(true); 106 this._selectedBrushStroke.setStrokeUseCalligraphic(true);
104 var strokeAngle = 0; 107 var strokeAngle = 0;
105 if (this.options.strokeAngle){ 108 if (this.options.strokeAngle){
106 strokeAngle= ShapesController.GetValueInPixels(this.options.strokeAngle.value, this.options.strokeAngle.units); 109 strokeAngle= this.options.strokeAngle.value;
107 } 110 }
108 this._selectedBrushStroke.setStrokeAngle(Math.PI * -strokeAngle/180); 111 this._selectedBrushStroke.setStrokeAngle(Math.PI * -strokeAngle/180);
109 } else { 112 } else {