Skip to content

Commit

Permalink
Update line dash type and calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
microbit-robert committed Nov 28, 2024
1 parent 1fd433e commit cfd569d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion smoothie.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export interface ITimeSeriesPresentationOptions {
/**
* Only supported for charts using fixed axes and linear interpolation.
*/
lineDash?: [number, number];
lineDash?: number[];
fillStyle?: string;
lineWidth?: number;
/**
Expand Down
2 changes: 1 addition & 1 deletion smoothie.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,7 @@
this.lineDashOffset = Number((removedLineLength + this.lineDashOffset).toFixed(2));

// Reset lineDashOffset to zero where possible.
const totalDashLength = lineDash[0] + lineDash[1];
const totalDashLength = lineDash.reduce((acc, curr) => acc + curr, 0);
if (this.lineDashOffset % totalDashLength === 0) {
this.lineDashOffset = 0;
}
Expand Down

0 comments on commit cfd569d

Please sign in to comment.