MAGE-323: safe zone handling#541
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 965b8ce. Configure here.
| let availableWidth = screenWidth - marginLeft - marginRight | ||
| let availableHeight = screenHeight - marginTop - marginBottom | ||
| let clampedWidth = min(width, availableWidth) | ||
| let clampedHeight = min(height, availableHeight) |
There was a problem hiding this comment.
Negative dimensions when margins exceed screen size
Medium Severity
availableWidth and availableHeight can become negative when the combined safe area insets and user-provided margins exceed the screen dimensions. Since clampedWidth and clampedHeight are computed via min(width, availableWidth), they inherit this negative value, resulting in a CGRect with negative dimensions. This could happen on smaller devices in landscape (where safe area left/right insets are significant) or with large user-configured margins. The values need to be floored at zero.
Reviewed by Cursor Bugbot for commit 965b8ce. Configure here.


Description
add safe zone to user provided offsets
Due Diligence
Release/Versioning Considerations
PatchContains internal changes or backwards-compatible bug fixes.MinorContains changes to the public API.MajorContains breaking changes.Changelog / Code Overview
Test Plan
Related Issues/Tickets