Skip to content

Improve bounds-change handling for bottomToTop layout#135

Merged
bryankeller merged 1 commit intomasterfrom
bk/improve-bottom-to-top-bounds-handling
Apr 17, 2025
Merged

Improve bounds-change handling for bottomToTop layout#135
bryankeller merged 1 commit intomasterfrom
bk/improve-bottom-to-top-bounds-handling

Conversation

@bryankeller
Copy link
Contributor

Details

This PR improves some bounds-change handling for the bottomToTop layout. The math is messy, but it works. There might be a deeper truth here that would simplify the calculation so that we don't need a different case for shrinking / growing bounds, and the weird clamp we need to do, but I haven't found it yet.

Simulator.Screen.Recording.-.iPhone.16.Pro.-.2025-04-16.at.21.04.47.mp4

Motivation and Context

Fixes an issue where a bounds change caused the collection view to not preserve the bottom visible item properly.

How Has This Been Tested

Example app.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@bryankeller bryankeller merged commit 28b7b44 into master Apr 17, 2025
1 check passed
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