fix: Fixed haptic feedback on color picker, b=no-bug, c=workspaces

This commit is contained in:
mr. m
2025-06-27 16:55:20 +02:00
parent 5930552cdc
commit d96d6831a2
2 changed files with 4 additions and 4 deletions

View File

@@ -41,7 +41,7 @@
}
const MAX_OPACITY = 0.8;
const MIN_OPACITY = 0.2;
const MIN_OPACITY = 0.3;
class nsZenThemePicker extends ZenMultiWindowFeature {
static MAX_DOTS = 3;
@@ -992,9 +992,9 @@
onOpacityChange(event) {
this.currentOpacity = parseFloat(event.target.value);
// If we reached a whole number (e.g., 0.1, 0.2, etc.), send a haptic feedback.
if (Math.abs((this.currentOpacity * 10) % 1) !== this._lastHapticFeedback) {
if (Math.round(this.currentOpacity * 10) !== this._lastHapticFeedback) {
Services.zen.playHapticFeedback();
this._lastHapticFeedback = Math.abs((this.currentOpacity * 10) % 1);
this._lastHapticFeedback = Math.round(this.currentOpacity * 10);
}
this.updateCurrentWorkspace();
}