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
master
刘夏 2016-10-25 22:46:38 +08:00 committed by Sérgio Gomes
parent 40290b399a
commit faff9e16ca
1 changed files with 2 additions and 2 deletions

View File

@ -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);
}