fix: use i32 for use_component_rect to prevent overflow#176
Merged
ccbrown merged 1 commit intoccbrown:mainfrom Mar 2, 2026
Merged
fix: use i32 for use_component_rect to prevent overflow#176ccbrown merged 1 commit intoccbrown:mainfrom
ccbrown merged 1 commit intoccbrown:mainfrom
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #176 +/- ##
=======================================
Coverage 89.06% 89.06%
=======================================
Files 34 34
Lines 5826 5826
Branches 5826 5826
=======================================
Hits 5189 5189
Misses 526 526
Partials 111 111
🚀 New features to boost your workflow:
|
canvas_position() returns Point<i16> and size() returns Size<u16>. Combining them in a Rect<u16> caused arithmetic overflow for off-screen components inside a ScrollView. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cfb158a to
99ed0b9
Compare
ccbrown
approved these changes
Mar 2, 2026
Owner
ccbrown
left a comment
There was a problem hiding this comment.
Looks fine to me, especially since this is still unreleased.
I've been considering a breaking change to replace all of the 16 bit types with 32 bit types anyway since there may be reasonable cases where coordinates beyond 65,535 are possible.
Contributor
Author
|
Yeah I was looking at making |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
canvas_position()returnsPoint<i16>andsize()returnsSize<u16>. Combining them in aRect<u16>caused arithmetic overflow for off-screen components inside aScrollView.use_component_rectto usei32to prevent the overflow.Test plan
ScrollViewthat are off-screen no longer cause arithmetic overflow panics.🤖 Generated with Claude Code