Skip to content

Commit 613aff1

Browse files
committed
click on mousedown
1 parent b7dc432 commit 613aff1

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "SpessaSynth",
3-
"version": "4.1.0",
3+
"version": "4.1.1",
44
"type": "module",
55
"private": true,
66
"scripts": {

src/website/js/synthesizer_ui/methods/synthui_meter.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,19 @@ export class Meter {
9797
if (activeChangeCallback) {
9898
activeChangeCallback(true);
9999
}
100+
const el = e.currentTarget as HTMLElement;
101+
const bounds = el.getBoundingClientRect();
102+
const relativeLeft = bounds.left;
103+
const width = bounds.width;
104+
const relative = e.clientX - relativeLeft;
105+
const percentage = Math.max(
106+
0,
107+
Math.min(1, relative / width)
108+
);
109+
if (!this.isLocked || isMobile) {
110+
this.toggleLock();
111+
}
112+
editCallback(percentage * (max - min) + min);
100113
} else {
101114
// Other, lock it
102115
this.toggleLock();

0 commit comments

Comments
 (0)