Skip to content

Commit

Permalink
add compile run button and mouse scroll hack
Browse files Browse the repository at this point in the history
  • Loading branch information
terryzfeng committed Oct 1, 2024
1 parent 9b8ed08 commit 4a8c620
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 3 deletions.
58 changes: 58 additions & 0 deletions src/rainfly/src/lib/assets/player-run-play.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions src/rainfly/src/lib/components/ActionButton.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import playerPlay from '$lib/assets/player-play.svg';
import playerStop from '$lib/assets/player-stop.svg';
import playerPause from '$lib/assets/player-pause.svg';
import playerRunPlay from '$lib/assets/player-run-play.svg';
let showStop = false;
let playButtonText = 'Play';
Expand Down Expand Up @@ -46,9 +47,9 @@
break;
default:
case Status.stop:
playButtonText = 'Run';
icon = playerPlay;
showStop = false;
playButtonText = 'Run';
icon = playerRunPlay;
}
}
Expand Down
9 changes: 8 additions & 1 deletion src/rainfly/src/lib/components/Visualizer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,14 @@
const samples = getRecordedSamples();
if (samples && samples[0].length === 0) return;
zoom = Math.max(0, Math.min(zoom + event.deltaY, MAX_ZOOM));
let scrollY = event.deltaY;
// hack: convert mouse scroll to trackpad scroll amount
if (Math.abs(scrollY) > 40) {
scrollY /= 40;
}
zoom = Math.max(0, Math.min(zoom + scrollY, MAX_ZOOM));
console.log("zoom", zoom);
slice.full = zoom === 0;
const max = getRecordedSamples()[0].length;
const position = event.clientX / window.innerWidth *
Expand Down

0 comments on commit 4a8c620

Please sign in to comment.