From 3bd5482700b3b9f688ed0b3d5d9c6134b9ec5106 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 16 Nov 2025 17:05:35 +0000 Subject: [PATCH] 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. --- src/app/app.component.ts | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/app/app.component.ts b/src/app/app.component.ts index d92c81a..f36586e 100644 --- a/src/app/app.component.ts +++ b/src/app/app.component.ts @@ -33,10 +33,7 @@ export class AppComponent { private readonly MAX_BRIGHTNESS = 3.0; // Computed signals for button states - isZoomAtMin = computed(() => { - const zoom = this.customZoomState(); - return zoom <= this.MIN_ZOOM + 0.01; // Small tolerance for float comparison - }); + isZoomAtMin = computed(() => this.customZoomState() <= this.MIN_ZOOM); isBrightnessAtMin = computed(() => this.customBrightnessState() <= this.MIN_BRIGHTNESS); isBrightnessAtMax = computed(() => this.customBrightnessState() >= this.MAX_BRIGHTNESS);