Skip to content

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
// 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