Commit 2fd0227
committed
Avoid binding multiple touch listeners for zoom.
For a two-finger pinch, if two touchstart events fire, this results in
two touchmove and touchend listeners. The first will have a single
location in the locations variable, but its touchmove listener will
fire with two touches, causing it to fail due to not finding the
location of the second touch.
If the first listener fires before the second, this exception breaks
touch zooming (as no further listeners will be called), but the order is
undefined so may be browser/device dependent (for reproducing the bug).
Since zooming only ever involves a single gesture at a time, it makes
more sense to only have one listener of each type at a time, unlike
dragging, which involves multiple drag gestures at once.1 parent dddef32 commit 2fd0227
3 files changed
Lines changed: 6 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1232 | 1232 | | |
1233 | 1233 | | |
1234 | 1234 | | |
1235 | | - | |
| 1235 | + | |
1236 | 1236 | | |
1237 | 1237 | | |
1238 | 1238 | | |
| |||
1266 | 1266 | | |
1267 | 1267 | | |
1268 | 1268 | | |
| 1269 | + | |
1269 | 1270 | | |
1270 | 1271 | | |
1271 | 1272 | | |
| |||
0 commit comments