Skip to content

Commit 4985433

Browse files
committed
fix meter ergonomics
1 parent 93af395 commit 4985433

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,14 @@ export class Meter {
221221
min,
222222
max
223223
};
224+
const relativeLeft = rect.left;
225+
const width = rect.width;
226+
const relative = e.clientX - relativeLeft;
227+
const percentage = Math.max(
228+
0,
229+
Math.min(1, relative / width)
230+
);
231+
editCallback(percentage * (max - min) + min);
224232
} else {
225233
// Other, lock it
226234
this.toggleLock();

0 commit comments

Comments
 (0)