Merge pull request from paulkaplan/fix-mouse-rounding

Round the values reported from the sensing mouse x/y reporters
This commit is contained in:
Paul Kaplan 2018-12-13 11:27:05 -05:00 committed by GitHub
commit 2f6527cb1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 10 deletions
test/unit

View file

@ -40,14 +40,14 @@ test('mouseDown', t => {
const m = new Mouse(rt);
m.postData({
x: 10,
y: 400,
x: 9.9,
y: 400.1,
isDown: true,
canvasWidth: 480,
canvasHeight: 360
});
t.strictEquals(m.getClientX(), 10);
t.strictEquals(m.getClientY(), 400);
t.strictEquals(m.getClientX(), 9.9);
t.strictEquals(m.getClientY(), 400.1);
t.strictEquals(m.getScratchX(), -230);
t.strictEquals(m.getScratchY(), -180);
t.strictEquals(m.getIsDown(), true);