-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Fix text placement line hit detection for pixelRatio !== 1 #15001
Fix text placement line hit detection for pixelRatio !== 1 #15001
Conversation
📦 Preview the website for this branch here: https://deploy-preview-15001--ol-site.netlify.app/. |
First test has no fill but detects wide stroke For the tests to pass use |
@mike-000 This looks fishy. Only the third test fails. If there is something wrong with pixel ratio handling for text hit detection, I would expect all three tests to fail on a device with a pixel ratio of 2. |
7021250
to
070d860
Compare
The wide stroke in the first test would extend outwards as well as into the center of the character - just enough to get a hit a [50, 50] even though the hit detection image was misplaced. Increase the pixel ratio beyond 2 the misplacement increases and it also would fail. |
@mike-000 Nevermind. I'm looking into a fix for the pixel ratio issue now. |
This is now ready for review. For those who have been following: I re-purposed this pull request to not only make the tests more readable, but fix the pixel ratio issue I encountered when running the tests on a system with a device pixel ratio other than 1. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your work on this, @ahocevar
This pull request makes the recently added tests for hit detection of line placement texts better readable.This pull request fixes the pixel ratio problem identified by the new text fill tests.