Skip to content

Fix division by zero in calculateResizeRatio causing NaN ratios#5

Closed
mass2527 wants to merge 1 commit intomainfrom
claude/fix-critical-issue-TRoDm
Closed

Fix division by zero in calculateResizeRatio causing NaN ratios#5
mass2527 wants to merge 1 commit intomainfrom
claude/fix-critical-issue-TRoDm

Conversation

@mass2527
Copy link
Owner

When the container is resized to very small dimensions (or zero), the
totalWidth or totalHeight could be zero, causing division by zero and
resulting in NaN ratio values. This would break the entire layout.

Added guard clauses to return the clamped ratio early when totalWidth
or totalHeight is zero or negative, preventing NaN propagation.

When the container is resized to very small dimensions (or zero), the
totalWidth or totalHeight could be zero, causing division by zero and
resulting in NaN ratio values. This would break the entire layout.

Added guard clauses to return the clamped ratio early when totalWidth
or totalHeight is zero or negative, preventing NaN propagation.
@claude
Copy link

claude bot commented Jan 22, 2026

No issues found. Checked for bugs and CLAUDE.md compliance.

@mass2527 mass2527 closed this Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments