From c7135de92b25b380bebcafac541821a3696cfdfa Mon Sep 17 00:00:00 2001 From: Pushkar Joshi Date: Tue, 12 Jun 2012 10:21:03 -0700 Subject: change the brush runtime to ignore hardness in case of strokewidth of 1 --- assets/canvas-runtime.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'assets') diff --git a/assets/canvas-runtime.js b/assets/canvas-runtime.js index c2ab0bd8..feb35187 100644 --- a/assets/canvas-runtime.js +++ b/assets/canvas-runtime.js @@ -2264,7 +2264,10 @@ NinjaCvsRt.RuntimeBrushStroke = Object.create(NinjaCvsRt.RuntimeGeomObj, { var disp = [brushStamp[t][0], brushStamp[t][1]]; var alphaVal = 1.0; var distFromOpaqueRegion = Math.abs(t-halfNumTraces) - opaqueRegionHalfWidth; - if (distFromOpaqueRegion>0) { + if (numTraces === 1){ + distFromOpaqueRegion = 0; + } + else if (distFromOpaqueRegion>0) { var transparencyFactor = distFromOpaqueRegion/maxTransparentRegionHalfWidth; alphaVal = 1.0 - transparencyFactor;//(transparencyFactor*transparencyFactor);//the square term produces nonlinearly varying alpha values alphaVal *= 0.5; //factor that accounts for lineWidth == 2 -- cgit v1.2.3