Skip to content

Commit 329b826

Browse files
authored
Disable fastPathSegment when data is decimated (#8465)
1 parent b467c0d commit 329b826

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/controllers/controller.line.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default class LineController extends DatasetController {
1212
update(mode) {
1313
const me = this;
1414
const meta = me._cachedMeta;
15-
const {dataset: line, data: points = []} = meta;
15+
const {dataset: line, data: points = [], _dataset} = meta;
1616
// @ts-ignore
1717
const animationsDisabled = me.chart._animationsDisabled;
1818
let {start, count} = getStartAndCountOfVisiblePoints(meta, points, animationsDisabled);
@@ -26,6 +26,7 @@ export default class LineController extends DatasetController {
2626
}
2727

2828
// Update Line
29+
line._decimated = !!_dataset._decimated;
2930
line.points = points;
3031

3132
// In resize mode only point locations change, so no need to set the options.

src/elements/element.line.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ function fastPathSegment(ctx, line, segment, params) {
179179
function _getSegmentMethod(line) {
180180
const opts = line.options;
181181
const borderDash = opts.borderDash && opts.borderDash.length;
182-
const useFastPath = !line._loop && !opts.tension && !opts.stepped && !borderDash;
182+
const useFastPath = !line._decimated && !line._loop && !opts.tension && !opts.stepped && !borderDash;
183183
return useFastPath ? fastPathSegment : pathSegment;
184184
}
185185

@@ -231,6 +231,7 @@ export default class LineElement extends Element {
231231
this._path = undefined;
232232
this._points = undefined;
233233
this._segments = undefined;
234+
this._decimated = false;
234235
this._pointsUpdated = false;
235236

236237
if (cfg) {

0 commit comments

Comments
 (0)