Skip to content

Commit 37a0fa0

Browse files
committed
docs: document what's going on with convex hull points
1 parent 0554ed7 commit 37a0fa0

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/RenderWebGL.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1888,6 +1888,10 @@ class RenderWebGL extends EventEmitter {
18881888
// *Not* Scratch Space-- +y is bottom
18891889
// Loop over all rows of pixels, starting at the top
18901890
for (let y = 0; y < height; y++) {
1891+
// See comment in Drawable.getLocalPosition for why we're adding 0.5 here.
1892+
// Essentially, _pixelPos is supposed to be in "texture space", and "texture space" positions are offset
1893+
// by 0.5. Notice that we're calling drawable.skin.isTouchingLinear (operates in texture space)
1894+
// and not drawable.isTouching (operates in Scratch space).
18911895
_pixelPos[1] = (y + 0.5) / height;
18921896

18931897
// We start at the leftmost point, then go rightwards until we hit an opaque pixel

0 commit comments

Comments
 (0)