Skip to content

Commit

Permalink
Improve variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
naomiaro committed Dec 12, 2021
1 parent 0b2851d commit b90681c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/render/CanvasHook.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,18 @@ class CanvasHook {
const maxValue = 2 ** (this.bits - 1);
const width = this.barWidth;
const gap = this.barGap;
const plusI = width + gap;
const barStart = width + gap;

cc.clearRect(0, 0, canvas.width, canvas.height);

cc.save();
cc.fillStyle = this.color;
cc.scale(scale, scale);

for (let i = 0; i < len; i += plusI) {
const minPeak = this.peaks[(i + this.offset) * 2] / maxValue;
const maxPeak = this.peaks[(i + this.offset) * 2 + 1] / maxValue;
CanvasHook.drawFrame(cc, h2, i, minPeak, maxPeak, width, gap);
for (let pixel = 0; pixel < len; pixel += barStart) {
const minPeak = this.peaks[(pixel + this.offset) * 2] / maxValue;
const maxPeak = this.peaks[(pixel + this.offset) * 2 + 1] / maxValue;
CanvasHook.drawFrame(cc, h2, pixel, minPeak, maxPeak, width, gap);
}

cc.restore();
Expand Down

0 comments on commit b90681c

Please sign in to comment.