Skip to content

Commit 18b7ed3

Browse files
dakerfinetjul
authored andcommitted
docs(Picking): fix screen coords when page is zoomed
fixes #3356
1 parent cb70d12 commit 18b7ed3

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Examples/Geometry/Picking/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,8 @@ function getScreenEventPositionFor(source) {
201201
const scaleX = canvasWidth / bounds.width;
202202
const scaleY = canvasHeight / bounds.height;
203203
const position = {
204-
x: scaleX * (source.clientX - bounds.left),
205-
y: scaleY * (bounds.height - source.clientY + bounds.top),
204+
x: Math.round(scaleX * (source.clientX - bounds.left)),
205+
y: Math.round(scaleY * (bounds.height - source.clientY + bounds.top)),
206206
z: 0,
207207
};
208208
return position;

0 commit comments

Comments
 (0)