Skip to content

Commit

Permalink
Fix context menu popping up when right-clicking ADSR ramp handles
Browse files Browse the repository at this point in the history
 * Swap out all ramp curve types to be bezier curve for the default composition
  • Loading branch information
Ameobea committed Jan 12, 2025
1 parent 5e82fe8 commit 3d8d6df
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 5 deletions.
7 changes: 6 additions & 1 deletion src/controls/adsr2/ConfigureRampControlPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,12 @@
const handleChange = (key: string, val: any) => state.update(s => ({ ...s, [key]: val }));
</script>

<div class="adsr2-configure-ramp-control-panel" style="top:{top}px; left:{left}px;">
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="adsr2-configure-ramp-control-panel"
style="top:{top}px; left:{left}px;"
on:contextmenu={e => e.preventDefault()}
>
<SvelteControlPanel
{settings}
state={$state}
Expand Down
7 changes: 6 additions & 1 deletion src/controls/adsr2/ConfigureStepControlPanel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,12 @@
};
</script>

<div class="adsr2-configure-step-control-panel" style="top:{top}px; left:{left}px;">
<!-- svelte-ignore a11y-no-static-element-interactions -->
<div
class="adsr2-configure-step-control-panel"
style="top:{top}px; left:{left}px;"
on:contextmenu={e => e.preventDefault()}
>
<SvelteControlPanel
{settings}
{state}
Expand Down
1 change: 1 addition & 0 deletions src/controls/adsr2/adsr2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,7 @@ class RampHandle {

if (evt.nativeEvent.button !== 0 || isDoubleClick) {
this.toggleConfigurator(evt.x, evt.y);
return;
}

this.dragData = evt;
Expand Down
2 changes: 1 addition & 1 deletion src/fmSynth/FMSynthUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -688,7 +688,7 @@ const ConnectedFMSynthUIInner: React.FC<ConnectedFMSynthUIProps> = ({
},
[synth]
)}
adsrs={synth.getAdsrs()}
adsrs={dbg(synth.getAdsrs())}
onAdsrChange={useCallback(
(adsrIx: number, newAdsr: AdsrParams) => synth.handleAdsrChange(adsrIx, newAdsr),
[synth]
Expand Down
2 changes: 1 addition & 1 deletion src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const createGlobalUI = (engine: typeof import('./engine')) => {
}
};

if (typeof AudioWorkletNode === 'undefined') {
if (typeof WebAssembly === 'undefined' || typeof AudioWorkletNode === 'undefined') {
createBrowserNotSupportedMessage();
} else {
initSentry();
Expand Down
2 changes: 1 addition & 1 deletion src/init-composition.json

Large diffs are not rendered by default.

0 comments on commit 3d8d6df

Please sign in to comment.