fix(ImagePreview):Issues #4391 ImagePreview缩放不跟手 (#4477)

This commit is contained in:
7115066 2019-09-18 10:56:32 +08:00 committed by neverland
parent 292054fd5d
commit df59c58ffc

View File

@ -13,10 +13,8 @@ const [createComponent, bem] = createNamespace('image-preview');
function getDistance(touches) {
return Math.sqrt(
Math.abs(
(touches[0].clientX - touches[1].clientX) *
(touches[0].clientY - touches[1].clientY)
)
((touches[0].clientX - touches[1].clientX) ** 2) +
((touches[0].clientY - touches[1].clientY) ** 2)
);
}