-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
On Firefox, the 1px line() does not align with the 1px line of the rect(). #7325
Comments
And if you translate(0.5, 0.5) before drawing the line and the rectangle, See the section "Obtaining crisp lines" here: source: https://developer.mozilla.org/en-US/docs/Web/API/Canvas_API/Tutorial/Applying_styles_and_colors I think that all shapes, (eg. ellipses, triangles, etc) should be analysed and compared on both Chrome and Firefox. |
@orbitalchicken I tried to reproduce this and to me it appeared perfect , tried the same for triangle as well and it the 1px line was aligned perfectly in both Chrome and Firefox using
|
@MuktiMishra Do you use a 4K monitor ? Here's your code on a standard 1K monitor: |
@orbitalchicken my bad i didn't tried on high resolution monitor |
This is not a consistent issue. On 1440p monitor As mentioned in #7317 and #7319, these are the behavior coming from the browsers not something we can fix (eg. you have replicated the same behavior using native canvas API). See also #4269 #5662 #5362 and others. This is a same behavior you'll see if you use the underlying graphics engine as well. One way to get around it is to force subpixel drawing by drawing on a |
Another explanation: https://web.archive.org/web/20200427185029/https://diveintohtml5.info/canvas.html (original site no longer up) Also if you change the magnification level on your browser, you will see this switch between aligning and not aligning as well (require rerunning the sketch). |
Most appropriate sub-area of p5.js?
p5.js version
1.11.0
Web browser and version
Firefox 131, Chrome 130
Operating system
Windows and Linux
Steps to reproduce this
Firerox on the left, Chrome on the right:
On Firefox, the 1px line() does not align with the 1px line of the rect().
The text was updated successfully, but these errors were encountered: