mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-06-02 08:33:56 -04:00
Merge pull request #1843 from paulkaplan/fix-mouse-rounding
Round the values reported from the sensing mouse x/y reporters
This commit is contained in:
commit
2f6527cb1d
2 changed files with 10 additions and 10 deletions
test/unit
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue