diff options
Diffstat (limited to 'js/lib/geom')
-rwxr-xr-x | js/lib/geom/brush-stroke.js | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/js/lib/geom/brush-stroke.js b/js/lib/geom/brush-stroke.js index b2e56149..d9c2ab53 100755 --- a/js/lib/geom/brush-stroke.js +++ b/js/lib/geom/brush-stroke.js | |||
@@ -45,7 +45,7 @@ var BrushStroke = function GLBrushStroke() { | |||
45 | this._strokeAmountSmoothing = 0; | 45 | this._strokeAmountSmoothing = 0; |
46 | 46 | ||
47 | // currently, brush does not support a fill region | 47 | // currently, brush does not support a fill region |
48 | this.canFill = false; | 48 | this.canFill = true; |
49 | 49 | ||
50 | //threshold that tells us whether two samples are too far apart | 50 | //threshold that tells us whether two samples are too far apart |
51 | this._MAX_SAMPLE_DISTANCE_THRESHOLD = 5; | 51 | this._MAX_SAMPLE_DISTANCE_THRESHOLD = 5; |
@@ -180,7 +180,7 @@ BrushStroke.prototype.setStrokeWidth = function (w) { | |||
180 | } | 180 | } |
181 | this._isDirty=true; | 181 | this._isDirty=true; |
182 | }; | 182 | }; |
183 | 183 | /* | |
184 | BrushStroke.prototype.getStrokeMaterial = function () { | 184 | BrushStroke.prototype.getStrokeMaterial = function () { |
185 | return this._strokeMaterial; | 185 | return this._strokeMaterial; |
186 | }; | 186 | }; |
@@ -188,18 +188,24 @@ BrushStroke.prototype.getStrokeMaterial = function () { | |||
188 | BrushStroke.prototype.setStrokeMaterial = function (m) { | 188 | BrushStroke.prototype.setStrokeMaterial = function (m) { |
189 | this._strokeMaterial = m; this._isDirty = true; | 189 | this._strokeMaterial = m; this._isDirty = true; |
190 | }; | 190 | }; |
191 | 191 | */ | |
192 | BrushStroke.prototype.getStrokeColor = function () { | 192 | BrushStroke.prototype.getStrokeColor = function () { |
193 | return this._strokeColor; | 193 | return null;//return this._strokeColor; |
194 | }; | 194 | }; |
195 | 195 | ||
196 | BrushStroke.prototype.setStrokeColor = function (c) { | 196 | BrushStroke.prototype.setStrokeColor = function (c) { |
197 | this._strokeColor = c; this._isDirty = true; | 197 | //this._strokeColor = c; this._isDirty = true; |
198 | }; | 198 | }; |
199 | 199 | ||
200 | BrushStroke.prototype.setFillColor = function(c){ | 200 | BrushStroke.prototype.setFillColor = function(c){ |
201 | return; | 201 | this._strokeColor = c; this._isDirty = true; |
202 | }; //NO-OP for now as we have no fill region | 202 | }; |
203 | //sets stroke color for now as we have no fill region | ||
204 | |||
205 | BrushStroke.prototype.getFillColor = function() { | ||
206 | return this._strokeColor; | ||
207 | }; | ||
208 | //return strokeColor for now as we have no fill region | ||
203 | 209 | ||
204 | BrushStroke.prototype.setSecondStrokeColor = function(c){ | 210 | BrushStroke.prototype.setSecondStrokeColor = function(c){ |
205 | this._secondStrokeColor=c; this._isDirty = true; | 211 | this._secondStrokeColor=c; this._isDirty = true; |
@@ -732,8 +738,7 @@ BrushStroke.prototype.drawToContext = function(ctx, drawStageWorldPts, stageWorl | |||
732 | ctx.strokeStyle = this.buildColor(ctx, this._strokeColor, w, h, this._strokeWidth, alphaVal); | 738 | ctx.strokeStyle = this.buildColor(ctx, this._strokeColor, w, h, this._strokeWidth, alphaVal); |
733 | } | 739 | } |
734 | //linearly interpolate between the two stroke colors | 740 | //linearly interpolate between the two stroke colors |
735 | var currStrokeColor = VecUtils.vecInterpolate(4, this._strokeColor, this._secondStrokeColor, t/numTraces); | 741 | //var currStrokeColor = VecUtils.vecInterpolate(4, this._strokeColor, this._secondStrokeColor, t/numTraces); |
736 | //ctx.strokeStyle="rgba("+parseInt(255*currStrokeColor[0])+","+parseInt(255*currStrokeColor[1])+","+parseInt(255*currStrokeColor[2])+","+alphaVal+")"; | ||
737 | ctx.translate(disp[0],disp[1]); | 742 | ctx.translate(disp[0],disp[1]); |
738 | ctx.beginPath(); | 743 | ctx.beginPath(); |
739 | if (drawStageWorldPts) { | 744 | if (drawStageWorldPts) { |