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

Add workaround for subpixel rounding #13

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

Conversation

hrjakobsen
Copy link
Contributor

Why

This is a workaround, and very much a request-for-comments if you can come up with a better idea

After merging #12 yesterday, I've noticed that the Firefox subpixel rounding removes the marker at some font sizes / marker width levels.

What changed

I think it happens since 1ch is a fractional value, hence the browser will have to do some rounding in the repeating pattern. What I cannot answer, however, is why this rounding sacrifices the 1px marker rather than the heap of transparent content right next to it.

The solution to add a little bit of "padding" to the marker is not great, but it's the best I could come up with that seemed to fix in all of my test cases.

Sorry for not catching this in yesterdays PR.

Before:
Screenshot from 2023-03-23 16-18-41

After:
Screenshot from 2023-03-23 16-20-50

@sergeichestakov
Copy link
Contributor

weird. is this issue only present on Firefox? im not sure I noticed it

@hrjakobsen
Copy link
Contributor Author

weird. is this issue only present on Firefox? im not sure I noticed it

I think so, yeah. My colleague didn't notice it happening on Safari at least.

@sergeichestakov
Copy link
Contributor

hmm which OS are you using? I'm on Firefox as well on MacOS and not seeing it

@hrjakobsen
Copy link
Contributor Author

firefox -v  
Mozilla Firefox 111.0.1

uname -a
Linux 5.19.0-35-generic #36~22.04.1-Ubuntu Fri Feb 17 15:17:25 UTC 2 x86_64 x86_64 x86_64 GNU/Linux

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.

2 participants