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

'fitrows': Last row item should always fit #1565

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

Conversation

marcigo36
Copy link

The last item in a row sometimes does not fit due to floating point inaccuracies.

Related issue: #1563

The last item in a row sometimes does not fit due to floating point inaccuracies.

Related issue: metafizzy#1563
@@ -42,7 +42,7 @@ proto._getItemLayoutPosition = function( item ) {
var itemWidth = item.size.outerWidth + this.gutter;
// if this element cannot fit in the current row
var containerWidth = this.isotope.size.innerWidth + this.gutter;
if ( this.x !== 0 && itemWidth + this.x > containerWidth ) {
if ( this.x !== 0 && itemWidth + this.x > containerWidth + 0.001 /*to prevent last item not fitting in some cases*/ ) {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure what is a safe value for this across all browsers.
Number.EPSILON definitely does not work.
Using something like 0.000001 has proven to be too small as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant