From 13bfabdaa02c97127f561e5f234ba2e6ac58b0ae Mon Sep 17 00:00:00 2001 From: WofWca Date: Wed, 6 Oct 2021 21:38:24 +0800 Subject: [PATCH] perf: improve `render` performance for `TimeSeries` with no stroke --- smoothie.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/smoothie.js b/smoothie.js index b5ba29f..d5a4903 100644 --- a/smoothie.js +++ b/smoothie.js @@ -935,9 +935,6 @@ var seriesOptions = this.seriesSet[d].options; - // Set style for this dataSet. - context.lineWidth = seriesOptions.lineWidth; - context.strokeStyle = seriesOptions.strokeStyle; // Draw the line... context.beginPath(); // Retain lastX, lastY for calculating the control points of bezier curves. @@ -1005,6 +1002,8 @@ } if (seriesOptions.strokeStyle && seriesOptions.strokeStyle !== 'none') { + context.lineWidth = seriesOptions.lineWidth; + context.strokeStyle = seriesOptions.strokeStyle; context.stroke(); } context.closePath();