aboutsummaryrefslogtreecommitdiff
path: root/js/lib/geom
diff options
context:
space:
mode:
authorPushkar Joshi2012-06-07 09:49:02 -0700
committerPushkar Joshi2012-06-07 09:49:02 -0700
commit763baf19f032c6fbae18963402b79d5d5510d923 (patch)
tree07873c1e70454135d7756e927118e4ff0880a301 /js/lib/geom
parent2dca8a0aa69981bc2a81c4a68f9061aef861f0ea (diff)
downloadninja-763baf19f032c6fbae18963402b79d5d5510d923.tar.gz
change the PI to make it look like the fill color affects the brush stroke color
Diffstat (limited to 'js/lib/geom')
-rwxr-xr-xjs/lib/geom/brush-stroke.js23
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/*
184BrushStroke.prototype.getStrokeMaterial = function () { 184BrushStroke.prototype.getStrokeMaterial = function () {
185 return this._strokeMaterial; 185 return this._strokeMaterial;
186}; 186};
@@ -188,18 +188,24 @@ BrushStroke.prototype.getStrokeMaterial = function () {
188BrushStroke.prototype.setStrokeMaterial = function (m) { 188BrushStroke.prototype.setStrokeMaterial = function (m) {
189 this._strokeMaterial = m; this._isDirty = true; 189 this._strokeMaterial = m; this._isDirty = true;
190}; 190};
191 191*/
192BrushStroke.prototype.getStrokeColor = function () { 192BrushStroke.prototype.getStrokeColor = function () {
193 return this._strokeColor; 193 return null;//return this._strokeColor;
194}; 194};
195 195
196BrushStroke.prototype.setStrokeColor = function (c) { 196BrushStroke.prototype.setStrokeColor = function (c) {
197 this._strokeColor = c; this._isDirty = true; 197 //this._strokeColor = c; this._isDirty = true;
198}; 198};
199 199
200BrushStroke.prototype.setFillColor = function(c){ 200BrushStroke.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
205BrushStroke.prototype.getFillColor = function() {
206 return this._strokeColor;
207};
208//return strokeColor for now as we have no fill region
203 209
204BrushStroke.prototype.setSecondStrokeColor = function(c){ 210BrushStroke.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) {