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
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion js/layout-modes/fit-rows.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.

this.x = 0;
this.y = this.maxY;
}
Expand Down