Skip to content

Commit 62aa2ac

Browse files
committed
Added check of valid userSetting in _drawLegend method
1 parent 5f255ac commit 62aa2ac

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/graph_spectrum_plot.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,9 @@ GraphSpectrumPlot._drawPowerSpectralDensityGraph = function (canvasCtx) {
431431
};
432432

433433
GraphSpectrumPlot._drawLegend = function (canvasCtx, WIDTH, HEIGHT, importedCurves) {
434+
if (!userSettings?.analyser_legend) {
435+
return;
436+
}
434437
const spectrumCount = importedCurves.length,
435438
legendPosX = parseInt(userSettings.analyser_legend.left) / 100 * WIDTH,
436439
legendPosY = parseInt(userSettings.analyser_legend.top) / 100 * HEIGHT,

0 commit comments

Comments
 (0)