Skip to content

Commit

Permalink
prefer Utils.toFixed when possible, phetsims/chipper#737
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Mar 26, 2021
1 parent 4b549ce commit ac2f624
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/common/view/PathsNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class PathsNode extends CanvasNode {

// Using built-in toFixed for performance reasons (similar to Color.computeCSS()), and in addition avoiding a lot
// of the mutation and overhead by just directly creating the CSS color string.
context.strokeStyle = `rgba(${baseColor.r},${baseColor.g},${baseColor.b},${alpha.toFixed( 20 )})`;
context.strokeStyle = `rgba(${baseColor.r},${baseColor.g},${baseColor.b},${Utils.toFixed( alpha, 20 )})`;
context.stroke();
}
}
Expand Down

0 comments on commit ac2f624

Please sign in to comment.