aboutsummaryrefslogtreecommitdiff
path: root/js/lib
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib')
-rwxr-xr-xjs/lib/geom/brush-stroke.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/js/lib/geom/brush-stroke.js b/js/lib/geom/brush-stroke.js
index 27d12f03..574cead1 100755
--- a/js/lib/geom/brush-stroke.js
+++ b/js/lib/geom/brush-stroke.js
@@ -657,11 +657,8 @@ var BrushStroke = function GLBrushStroke() {
657 ctx.lineCap="butt"; 657 ctx.lineCap="butt";
658 ctx.globalCompositeOperation = 'source-over'; 658 ctx.globalCompositeOperation = 'source-over';
659 ctx.globalAlpha = this._strokeColor[3]; 659 ctx.globalAlpha = this._strokeColor[3];
660 //todo figure out the correct formula for the line width 660
661 ctx.lineWidth=2; 661
662 if (t===numTraces-1){
663 ctx.lineWidth = 1;
664 }
665 for (t=0;t<numTraces;t++){ 662 for (t=0;t<numTraces;t++){
666 var disp = [brushStamp[t][0], brushStamp[t][1]]; 663 var disp = [brushStamp[t][0], brushStamp[t][1]];
667 var alphaVal = 1.0; 664 var alphaVal = 1.0;
@@ -671,6 +668,12 @@ var BrushStroke = function GLBrushStroke() {
671 alphaVal *= 1.0/ctx.lineWidth; //factor that accounts for lineWidth !== 1 668 alphaVal *= 1.0/ctx.lineWidth; //factor that accounts for lineWidth !== 1
672 } 669 }
673 ctx.save(); 670 ctx.save();
671 if (t === (numTraces-1)){
672 ctx.lineWidth = 1;
673 } else {
674 //todo figure out the correct formula for the line width
675 ctx.lineWidth=2;
676 }
674 ctx.strokeStyle="rgba("+parseInt(255*this._strokeColor[0])+","+parseInt(255*this._strokeColor[1])+","+parseInt(255*this._strokeColor[2])+","+alphaVal+")"; 677 ctx.strokeStyle="rgba("+parseInt(255*this._strokeColor[0])+","+parseInt(255*this._strokeColor[1])+","+parseInt(255*this._strokeColor[2])+","+alphaVal+")";
675 //linearly interpolate between the two stroke colors 678 //linearly interpolate between the two stroke colors
676 var currStrokeColor = VecUtils.vecInterpolate(4, this._strokeColor, this._secondStrokeColor, t/numTraces); 679 var currStrokeColor = VecUtils.vecInterpolate(4, this._strokeColor, this._secondStrokeColor, t/numTraces);