konvajs / konva

Konva.js is an HTML5 Canvas JavaScript framework that extends the 2d context by enabling canvas interactivity for desktop and mobile applications.
http://konvajs.org/
Other
11.59k stars 926 forks source link

'touchstart' sometimes can't get right shape #217

Closed ArcRain closed 7 years ago

ArcRain commented 7 years ago

I tested a simple page with my iPad mini2 (iOS version: 10.2.1) and iPhone6 Plus (iOS version: 10.2.1). I added three images into one layer. Then I tried to drag images. Sometimes I can dragged all of them. Sometimes I can drag only one or two. The two cases occurred randomly.

I tried to debug sources and found the color key maybe be the problem. When I touched a image and the event 'touchstart' is triggered, the 'getIntersection' return 'null'. It can't be matched with shapes' colorKey sometimes.

How to resolve this issue? Thanks.

issue2 issue
lavrton commented 7 years ago

take a look here: https://github.com/konvajs/konva/issues/187 The issue is no fixed yet. But you can create a simple workaround.

ArcRain commented 7 years ago

Thanks a lot~I'll use the temporary method to fix my problem.