mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-06-06 10:14:09 -04:00
Improve Chrome fix to handle wrong coordinates in both directions.
Closes #800.
This commit is contained in:
parent
21f4141e4f
commit
cc1e58e243
1 changed files with 4 additions and 3 deletions
|
@ -762,9 +762,10 @@ new function() { // Injection scope for mouse events on the browser
|
||||||
// bizarre workaround for an issue of Chrome on Windows:
|
// bizarre workaround for an issue of Chrome on Windows:
|
||||||
// TODO: Remove again after Dec 2016 once it is fixed in Chrome.
|
// TODO: Remove again after Dec 2016 once it is fixed in Chrome.
|
||||||
var offset = DomEvent.getOffset(event, view._element),
|
var offset = DomEvent.getOffset(event, view._element),
|
||||||
min = 1 << 25;
|
x = offset.x,
|
||||||
if (offset.x < -min)
|
abs = Math.abs(x),
|
||||||
offset.x += min;
|
max = 1 << 25;
|
||||||
|
offset.x = abs - max < abs ? (abs - max) * (x < 0 ? -1 : 1) : x;
|
||||||
handleMouseMove(view, view.viewToProject(offset), event);
|
handleMouseMove(view, view.viewToProject(offset), event);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue