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:
parent
96458b148c
commit
3bd5482700
1 changed files with 1 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue