Skip to content

Add workaround for subpixel rounding - #13

Open
hrjakobsen wants to merge 1 commit into
replit:mainfrom
overleaf:mj-css-subpixel-rounding
Open

Add workaround for subpixel rounding#13
hrjakobsen wants to merge 1 commit into
replit:mainfrom
overleaf:mj-css-subpixel-rounding

Conversation

@hrjakobsen

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@hrjakobsen

Copy link
Copy Markdown
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
Copy Markdown
Contributor

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

@hrjakobsen

Copy link
Copy Markdown
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