mirror of
https://github.com/scratchfoundation/paper.js.git
synced 2025-01-19 14:10:14 -05: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:
|
||||
// TODO: Remove again after Dec 2016 once it is fixed in Chrome.
|
||||
var offset = DomEvent.getOffset(event, view._element),
|
||||
min = 1 << 25;
|
||||
if (offset.x < -min)
|
||||
offset.x += min;
|
||||
x = offset.x,
|
||||
abs = Math.abs(x),
|
||||
max = 1 << 25;
|
||||
offset.x = abs - max < abs ? (abs - max) * (x < 0 ? -1 : 1) : x;
|
||||
handleMouseMove(view, view.viewToProject(offset), event);
|
||||
}
|
||||
},
|
||||
|
|
Loading…
Reference in a new issue