Skip to content

Commit

Permalink
Improve rendering for the faded out part of the path, see #330
Browse files Browse the repository at this point in the history
  • Loading branch information
samreid committed Aug 11, 2020
1 parent 67cac96 commit 1a3b786
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/common/view/PathsCanvasNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,13 @@ class PathsCanvasNode extends CanvasNode {
context.stroke();

// Draw the faded out part
context.lineCap = 'butt';

// Using "butt" is too "feathered" and makes the stroke look less bold than it should be
context.lineCap = 'square';

// Using "square" makes the stroke too wide, so we must trim it down accordingly.
context.lineWidth = STROKE_WIDTH * 0.6;

const faded = body.color;

while ( body.pathLength < maxPathLength && j > 0 ) {
Expand Down

0 comments on commit 1a3b786

Please sign in to comment.