Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: implement threshold-based FAB position validation #88

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

zeeshanahmad0201
Copy link

Fixes #87

The previous implementation used exact integer comparison which was too strict for real-world scenarios. This change introduces a threshold-based approach that:

  • Uses 10% of the navigation bar width as tolerance
  • Better handles floating-point precision
  • Maintains proper alignment validation
  • Provides more reliable position detection

Changes made:

  • Replaced integer comparison with double values
  • Added threshold calculation (10% of width)
  • Updated validation logic to use distance-based checks
  • Maintained original validation intent while being more practical

Test Cases:

  • Centered FAB with GapLocation.center now works properly
  • End-positioned FAB with GapLocation.end continues to work
  • Slight misalignments (within 10% threshold) are properly handled

Note: The previous fix in #23 was a step in the right direction but didn't fully resolve the position validation issues. This PR builds on that work to provide a more robust solution.

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.

FAB position validation still throws exception with centered position
1 participant