Coder Social home page Coder Social logo

Comments (7)

xaios avatar xaios commented on May 17, 2024 2

image

这样子就好了

from we-cropper.

sophiaWang611 avatar sophiaWang611 commented on May 17, 2024

我也遇到了相同的问题,debug之后发现是touch事件中的对象被更新了。

单指移动剪裁框时,touchStart方法里面看到touches数组只有个一个对象,见下图:
qq20180418-153415

同次事件,touchMove里面的touches数组多了一个function对象,以至于在后面判断是否两指操作上面进入了错误的分支,并在计算scale的时候出了错,见下图:
19b86fb7-4074-447c-89c6-3715e197daef

目前我们项目里面只是在这边粗暴的把function对象从touch数组中过滤掉来解决这个问题,至于为什么event的touches里面会混入function对象还没有找到原因。

from we-cropper.

bb54661447 avatar bb54661447 commented on May 17, 2024

我也遇到了同样的问题,但是根据楼上的说法,我检测了我的touches数组,并没有多,而且我的时ios可以,安卓会黑屏

from we-cropper.

dlhandsome avatar dlhandsome commented on May 17, 2024

@sophiaWang611 感谢定位问题,另外,是否只在特定机型特定基础库出现呢?

from we-cropper.

ethanzhrepo avatar ethanzhrepo commented on May 17, 2024

相同的问题。 在iphone6s、iphone x下真机测试每次都能复现。
微信版本6.6.6

经过测试,在微信里传入的 e.touches数组里有多个function。

解决方案:

touchMove里面重新定义了一个数组,然后遍历e.touches, typeof == 'object'的push到新数组,过滤掉function对象后解决了。

我这边调试发现的是 e.touches里不止一个function,而是会有很多很多个。

不知道是否是因为引入了阿拉丁小程序统计js的问题, 屏蔽掉该JS后问题依然存在。 过滤掉function对象后恢复正常。

from we-cropper.

lyfhh56789 avatar lyfhh56789 commented on May 17, 2024

同样遇到类似问题。我的在模拟器上没问题,放手机上touches数组会多很多个null,过滤掉也不行,我把代码中判断单双指的数组改成了changedTouches,单指拖动不消失了,但是图片会歪到右下角不能再拖动,双指还是会消失,,我把源码整个拷到项目都不行。总体来说没法用

from we-cropper.

renewfan avatar renewfan commented on May 17, 2024

页面调用正常使用,小程序退回到聊天页面在我的小程序页面打开小程序选中照片裁剪会闪退

from we-cropper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.