Thresholds: fix crash when trying to render zero-height base thresholds (#45256)

This commit is contained in:
Leon Sorokin
2022-02-10 11:49:30 -06:00
committed by GitHub
parent 9af6202a7f
commit 586b89f776

View File

@@ -134,6 +134,10 @@ export function scaleGradient(u: uPlot, scaleKey: string, scaleStops: ScaleValue
let range = minStopPos - maxStopPos;
if (range === 0) {
return scaleStops[maxStopIdx!][1];
}
let x0, y0, x1, y1;
if (u.scales.x!.ori === ScaleOrientation.Horizontal) {