diff options
author | Pushkar Joshi | 2012-06-12 10:16:20 -0700 |
---|---|---|
committer | Pushkar Joshi | 2012-06-12 10:16:20 -0700 |
commit | 4d9b676db06a3d4ff5f4cf0f35e8fc998e0000c5 (patch) | |
tree | 97f435d1c043bc8b624e53bcf0edbcdce568fbd7 /js/lib | |
parent | 0dd995834865202de1c51b1b4635f6515f54b1ea (diff) | |
download | ninja-4d9b676db06a3d4ff5f4cf0f35e8fc998e0000c5.tar.gz |
ignore hardness for calligraphic brushes if stroke width is 1
Diffstat (limited to 'js/lib')
-rwxr-xr-x | js/lib/geom/brush-stroke.js | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/js/lib/geom/brush-stroke.js b/js/lib/geom/brush-stroke.js index d9c2ab53..0e0406dd 100755 --- a/js/lib/geom/brush-stroke.js +++ b/js/lib/geom/brush-stroke.js | |||
@@ -719,7 +719,10 @@ BrushStroke.prototype.drawToContext = function(ctx, drawStageWorldPts, stageWorl | |||
719 | var disp = [brushStamp[t][0], brushStamp[t][1]]; | 719 | var disp = [brushStamp[t][0], brushStamp[t][1]]; |
720 | var alphaVal = 1.0; | 720 | var alphaVal = 1.0; |
721 | var distFromOpaqueRegion = Math.abs(t-halfNumTraces) - opaqueRegionHalfWidth; | 721 | var distFromOpaqueRegion = Math.abs(t-halfNumTraces) - opaqueRegionHalfWidth; |
722 | if (distFromOpaqueRegion>0) { | 722 | if (numTraces === 1){ |
723 | distFromOpaqueRegion = 0; | ||
724 | } | ||
725 | else if (distFromOpaqueRegion>0) { | ||
723 | var transparencyFactor = distFromOpaqueRegion/maxTransparentRegionHalfWidth; | 726 | var transparencyFactor = distFromOpaqueRegion/maxTransparentRegionHalfWidth; |
724 | alphaVal = 1.0 - transparencyFactor;//(transparencyFactor*transparencyFactor);//the square term produces nonlinearly varying alpha values | 727 | alphaVal = 1.0 - transparencyFactor;//(transparencyFactor*transparencyFactor);//the square term produces nonlinearly varying alpha values |
725 | alphaVal *= 0.5; //factor that accounts for lineWidth == 2 | 728 | alphaVal *= 0.5; //factor that accounts for lineWidth == 2 |