Skip to content

Commit

Permalink
perf: improve render performance for TimeSeries with no stroke
Browse files Browse the repository at this point in the history
  • Loading branch information
WofWca committed Oct 7, 2021
1 parent 42b26b1 commit 13bfabd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions smoothie.js
Expand Up @@ -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.
Expand Down Expand Up @@ -1005,6 +1002,8 @@
}

if (seriesOptions.strokeStyle && seriesOptions.strokeStyle !== 'none') {
context.lineWidth = seriesOptions.lineWidth;
context.strokeStyle = seriesOptions.strokeStyle;
context.stroke();
}
context.closePath();
Expand Down

0 comments on commit 13bfabd

Please sign in to comment.