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

Columns miscalculated due to rounding issue #314

Closed
Isaac-Hall opened this issue Jun 16, 2020 · 9 comments
Closed

Columns miscalculated due to rounding issue #314

Isaac-Hall opened this issue Jun 16, 2020 · 9 comments

Comments

@Isaac-Hall
Copy link

Shuffle version
v5.2.2

Describe the bug
For some reason Chrome returns the value of testComputedSize() as 9.99982px instead of 10px, even though box-sizing is calculating the widths of the items properly, which means the padding gets added twice (once by box-sizing including the paddings in the getComputedStyle value, and once by your logic below that in getNumberStyle).

I had a hunch that Chrome is returning the value differently due to screen pixel density, all of my testing suggests otherwise. I have no idea why Chrome is behaving so weirdly. In any case, an easy fix is to change your value var in testComputerSize() function like this:

value = Math.round(getNumber(window.getComputedStyle(e, null).width)) === 10;

Desktop (please complete the following information):

  • OS: Windows 10
  • Browser: Chrome
  • Version: All Chrome versions after 80
@auscaster
Copy link

This will most likely solve #306 and #317

@foxnoodles

This comment has been minimized.

@Vestride
Copy link
Owner

This project is nearly feature complete. You're welcome to send a PR to fix this if it's actually still an issue.

@foxnoodles

This comment has been minimized.

@Vestride
Copy link
Owner

Wow. You are the epitome of why open source sucks.

@Isaac-Hall
Copy link
Author

Shuffle is available to everyone for free, has been taken care of for over 8 years, and still this dude is here saying "How dare your FREE code not be perfectly up to my standards" while providing nothing himself.

Honestly, who hurt you foxnoodles?

Anyway, I couldn't reproduce this bug on my colleagues computer and the only difference I could think of is that I'm running a 1440p screen and he's running a 1080p one, but when I scaled down to 1080p it made no difference. I provided the "fix" in the hopes it would help with discovering what's wrong, but it's a good rule not to go editing scripts without knowing exactly what's going on, so I don't think a pull request makes sense unless people can verify that it is an issue with Shuffle and not with Chrome or some zoom/OS/pixel density situation.

@Vestride
Copy link
Owner

Thanks @Isaac-Hall :)

@auscaster
Copy link

auscaster commented Feb 21, 2021 via email

@Vestride
Copy link
Owner

Fixed with #351. Released in v5.4.1.

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

No branches or pull requests

4 participants