AlloyTeam / AlloyCrop

The best and tiny size mobile cropping component - 做最好且最小的移动裁剪组件
https://alloyteam.github.io/AlloyCrop/
943 stars 145 forks source link

为啥 在 pressMove 方法中 没有做 横向范围判断? #16

Open twoer opened 6 years ago

twoer commented 6 years ago

pressMove 方法

if((cr.left + evt.deltaX <= 0) && (cr.right + evt.deltaX >= self.width)){ self.img.translateX += evt.deltaX; }

->

var boxOffX = (document.documentElement.clientWidth - self.width)/2; if((boxOffX - cr.left - evt.deltaX >= 0) && (cr.right + evt.deltaX - boxOffX>= self.width)){ self.img.translateX += evt.deltaX; }