Skip to content

Commit

Permalink
Resolve merge conflict
Browse files Browse the repository at this point in the history
Co-authored-by: Philipp Kramer <philipp.kramer@fau.de>
Co-authored-by: Leander Tolksdorf <leandet98@zedat.fu-berlin.de>
Co-authored-by: Jan Degen <jan.degen@fau.de>
Signed-off-by: Jens Wächtler <jens.f.waechtler@fau.de>
  • Loading branch information
4 people committed Dec 7, 2022
1 parent 3069ea3 commit 8cec827
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Apps/frontend/src/components/Waves.svelte
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
<script>
import { beforeUpdate, onMount } from "svelte";
import { ColorRGBA, WebglPlot, WebglSquare, WebglThickLine } from "webgl-plot";
import {
ColorRGBA,
WebglPlot,
WebglSquare,
WebglThickLine,
} from "webgl-plot";
import {
CANVAS_HEIGHT,
CANVAS_WIDTH,
Expand Down Expand Up @@ -68,7 +73,9 @@
let xNew = Math.round(xCurr);
for (let x = xLast[channelIndex] + 1; x < xNew + 1; x++) {
channelSamples[channelIndex][x] = samples[channelIndex];
channelSamples[channelIndex][(x+WAVE_CURSOR_SIZE) % canvasElement.width] = undefined;
channelSamples[channelIndex][
(x + WAVE_CURSOR_SIZE) % canvasElement.width
] = undefined;
}
xLast[channelIndex] = xNew;
Expand Down Expand Up @@ -121,8 +128,8 @@
const size = 0.01;
let x = (xArr[i] * 2) / CANVAS_WIDTH - 1;
let scale = lines[i].scaleY * 5;
let y = channelSamples[i][xLast[i]-1] * 100 * scale / CANVAS_HEIGHT;
heads[i].setSquare(x - (size/2), y - size, x + (size/2), y + size);
let y = (channelSamples[i][xLast[i] - 1] * 100 * scale) / CANVAS_HEIGHT;
heads[i].setSquare(x - size / 2, y - size, x + size / 2, y + size);
}
};
Expand Down

0 comments on commit 8cec827

Please sign in to comment.