You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is the output of multiple rect(x,y,3,3) calls rendered with default P2D.
Black pixels are placed 1px apart to provide a reference. Fill is green, stroke is red.
It seems that the stroke is overlayed starting at the top left corner but extending one extra pixel down and to the right. If this is intended, I wonder what's the reasoning behind it?
The text was updated successfully, but these errors were encountered:
First, let's assume it's in the center of the pixel. So the drawing from x to x+3 will fill the pixels x, x+1, x+2, x+3, because there's only 3 pixels between the center of x and x+3.
Second, think as the coordinates are in the upper left corner of the pixel. So that drawing from x to x+3 will fill x, x+1, x+2 (and not the x+3 because this coordinate is on the left edge).
Anyway it seems the renderer uses these 2 different centers in your example.
If the stroke weight is 1 px, 0.5 px would overlap the edge of the rect and 0.5 px would lay outside of the rect (so total width/height of the rectangle increases by 0.5 + 0.5 = 1 px). We move the stroke 0.5 px down and to the right to align in with pixel grid (otherwise it would be in two pixel columns/rows and would be blurred by antialiasing). We do this to make both strokes and shapes appear sharp in P2D.
This is the output of multiple rect(x,y,3,3) calls rendered with default P2D.
Black pixels are placed 1px apart to provide a reference. Fill is green, stroke is red.
It seems that the stroke is overlayed starting at the top left corner but extending one extra pixel down and to the right. If this is intended, I wonder what's the reasoning behind it?
The text was updated successfully, but these errors were encountered: