Skip to content

Commit 622177f

Browse files
committed
Code improvement
1 parent 10364a2 commit 622177f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

src/graph_spectrum_plot.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,6 @@ GraphSpectrumPlot._drawFrequencyGraph = function (canvasCtx) {
222222
const WIDTH = canvasCtx.canvas.width;
223223
const LEFT = canvasCtx.canvas.left;
224224
const TOP = canvasCtx.canvas.top;
225-
226225
const PLOTTED_BUFFER_LENGTH = this._fftData.fftLength / this._zoomX;
227226
const PLOTTED_BLACKBOX_RATE = this._fftData.blackBoxRate / this._zoomX;
228227

@@ -262,11 +261,11 @@ GraphSpectrumPlot._drawFrequencyGraph = function (canvasCtx) {
262261
x += stepX;
263262
}
264263

264+
const scaleX = 2 * WIDTH / PLOTTED_BLACKBOX_RATE * this._zoomX;
265265
const spectrumCount = this._importedSpectrums.curvesCount();
266266
for (let spectrumNum = 0; spectrumNum < spectrumCount; spectrumNum++) {
267267
const curvesPonts = this._importedSpectrums._curvesData[spectrumNum].points;
268268
const pointsCount = curvesPonts.length;
269-
const scaleX = 2 * WIDTH / PLOTTED_BLACKBOX_RATE * this._zoomX;
270269

271270
canvasCtx.beginPath();
272271
canvasCtx.lineWidth = 1;
@@ -460,7 +459,6 @@ GraphSpectrumPlot.getPSDbyFreq = function(frequency) {
460459

461460
GraphSpectrumPlot._drawFrequencyVsXGraph = function (canvasCtx, drawPSD = false) {
462461
const PLOTTED_BLACKBOX_RATE = this._fftData.blackBoxRate / this._zoomX;
463-
464462
const ACTUAL_MARGIN_LEFT = this._getActualMarginLeft();
465463
const WIDTH = canvasCtx.canvas.width - ACTUAL_MARGIN_LEFT;
466464
const HEIGHT = canvasCtx.canvas.height - MARGIN_BOTTOM;

0 commit comments

Comments
 (0)