Fix: Blurry text when devicePixelRatio
is less than one
#127
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
This PR fixes a bug where the text will be blurry on devices that have a
devicePixelRatio
less than1
. This is an edge-case I had to debug and fix on production for an enterprise Pixi application a few years ago, so when I was casually browsing the source code and noticed it, I forked it to add this fix so you don't get caught by it too. All this PR does is changes the check for yourresolution
Pixi configuration option to be a<=
instead of a strict===
. Effectively clamping theresolution
to2
if thedevicePixelRatio
is less than 1.0.The Bug
Having a
devicePixelRatio
less than 1.0 is generally pretty unusual, however it is much more common in enterprise environments (office workers, construction workers, product planners, etc) due to both accessibility tools or janky browser plugins/extensions often mandated by corporate IT departments. The easiest way to reproduce this is to change your browser zoom to be less than 100%.Reproduction Steps
1.) Easiest way to repro this is to change your browser zoom to be less than 100%.
2.) Load up early.quadratic.to. If your
devicePixelRatio
is less than 1.0, you should notice blurry text.Here is what I saw:
Before:
After:
Overall a very cool product! Best of luck to y'all :D
Cheers.