mirror of
https://github.com/google/material-design-lite.git
synced 2024-08-17 00:00:24 +03:00
fix ripple.js bug (#4865)
* fix ripple.js bug when the clientX or clientY value is 0 , it will be wrong! * fix ripple mousedown bug when clientX or clientY value is 0, it will be wrong
This commit is contained in:
parent
40290b399a
commit
faff9e16ca
@ -102,8 +102,8 @@
|
||||
x = Math.round(bound.width / 2);
|
||||
y = Math.round(bound.height / 2);
|
||||
} else {
|
||||
var clientX = event.clientX ? event.clientX : event.touches[0].clientX;
|
||||
var clientY = event.clientY ? event.clientY : event.touches[0].clientY;
|
||||
var clientX = event.clientX !== undefined ? event.clientX : event.touches[0].clientX;
|
||||
var clientY = event.clientY !== undefined ? event.clientY : event.touches[0].clientY;
|
||||
x = Math.round(clientX - bound.left);
|
||||
y = Math.round(clientY - bound.top);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user