generated from dave/wails-template
Compare commits
2 Commits
f454bb48f9
...
0d295c6361
Author | SHA1 | Date | |
---|---|---|---|
0d295c6361 | |||
fbffdc40f6 |
@@ -15,7 +15,8 @@
|
||||
|
||||
function handleWheel(event: WheelEvent) {
|
||||
event.preventDefault();
|
||||
const delta = event.deltaY > 0 ? -4 : 4;
|
||||
const increment = event.shiftKey ? 1 : 4;
|
||||
const delta = event.deltaY > 0 ? -increment : increment;
|
||||
const newBrightness = Math.max(0, Math.min(100, brightness + delta));
|
||||
if (newBrightness !== brightness) {
|
||||
brightness = newBrightness;
|
||||
|
@@ -11,7 +11,9 @@
|
||||
});
|
||||
|
||||
function handleBrightnessChange(lamp: number, brightness: number) {
|
||||
SetLampBrightness(lamp, brightness);
|
||||
// Brightness is actually 1-255 and not 1-100
|
||||
// But we want the frontend to show 1-100 as in %
|
||||
SetLampBrightness(lamp, Math.round(brightness * 2.55));
|
||||
}
|
||||
</script>
|
||||
|
||||
|
Reference in New Issue
Block a user