From ac2f6241572e3902f59b6c09021d6204174b0b44 Mon Sep 17 00:00:00 2001 From: zepumph Date: Fri, 26 Mar 2021 11:48:11 -0800 Subject: [PATCH] prefer Utils.toFixed when possible, https://github.com/phetsims/chipper/issues/737 --- js/common/view/PathsNode.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/common/view/PathsNode.js b/js/common/view/PathsNode.js index c3bb85f1..5bf613d9 100644 --- a/js/common/view/PathsNode.js +++ b/js/common/view/PathsNode.js @@ -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(); } }