fix: Remove tolerance from isZoomAtMin to match brightness pattern

Fixed zoom minus button not being disabled at initial state.

The issue was the tolerance in the isZoomAtMin computed signal:
- Was: zoom <= MIN_ZOOM + 0.01 (with tolerance)
- Now: zoom <= MIN_ZOOM (exact, like brightness)

Brightness controls work perfectly because isBrightnessAtMin uses
an exact comparison without tolerance. Now zoom works the same way.

With the tolerance, the initial state (1.0) might not have been
considered "at min" depending on floating point precision, causing
the button to stay enabled when it should be disabled.
This commit is contained in:
Claude 2025-11-16 17:05:35 +00:00
parent 96458b148c
commit 3bd5482700
No known key found for this signature in database

View file

@ -33,10 +33,7 @@ export class AppComponent {
private readonly MAX_BRIGHTNESS = 3.0; private readonly MAX_BRIGHTNESS = 3.0;
// Computed signals for button states // Computed signals for button states
isZoomAtMin = computed(() => { isZoomAtMin = computed(() => this.customZoomState() <= this.MIN_ZOOM);
const zoom = this.customZoomState();
return zoom <= this.MIN_ZOOM + 0.01; // Small tolerance for float comparison
});
isBrightnessAtMin = computed(() => this.customBrightnessState() <= this.MIN_BRIGHTNESS); isBrightnessAtMin = computed(() => this.customBrightnessState() <= this.MIN_BRIGHTNESS);
isBrightnessAtMax = computed(() => this.customBrightnessState() >= this.MAX_BRIGHTNESS); isBrightnessAtMax = computed(() => this.customBrightnessState() >= this.MAX_BRIGHTNESS);