-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Description
What happened?
Hello ,
In the pickPositionWorldCoordinates function at line 632:
| drawingBufferPosition.y = scene.drawingBufferHeight - drawingBufferPosition.y; |
There is a Y-coordinate flip:
drawingBufferPosition.y = scene.drawingBufferHeight - drawingBufferPosition.y;
However, this creates an off-by-one error. When drawingBufferPosition.y = 0, the result becomes scene.drawingBufferHeight, which is out of bounds since valid pixel coordinates should range from [0, scene.drawingBufferHeight - 1].
For example, with a drawing buffer height of 270:
Input: y = 0 → Output: y = 270 (invalid - should be 269)
Input: y = 269 → Output: y = 1 (valid)
Should this be corrected to:
drawingBufferPosition.y = scene.drawingBufferHeight - drawingBufferPosition.y - 1
This would ensure the coordinate stays within valid bounds [0, height-1] after the flip.
Is this intentional behavior, or should it be fixed?