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

Ensure rect is rounded correctly #170

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

AlexKolpa
Copy link

This fixes a bug introduced in #116, which introduced rounding on the element rect. When a containment is specified that itself has non-integer values in its bounding rect, you get a rounding issue as top and left will be floored, causing them to go out of the containment bounding rect.
Say you have a container element with left: 100.5 and the element rect at left: 100.5 as well; this then gets rounded down to left: 100, meaning it is no longer considered completely visible.

This fixes a bug introduced in joshwnj#116, which introduced rounding on the element rect. When a `containment` is specified that itself has non-integer values in its bounding rect, you get a rounding issue as `top` and `left` will be floored, causing them to go out of the containment bounding rect.
Say you have a container element with `left: 100.5` and the element rect at `left: 100.5` as well; this then gets rounded down to `left: 100`, meaning it is no longer considered completely visible.
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.

1 participant