File tree Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Expand file tree Collapse file tree 2 files changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import { Canvas } from '@antv/f-engine';
3
3
function convertTouches ( touches ) {
4
4
if ( ! touches ) return touches ;
5
5
touches . forEach ( ( touch ) => {
6
- touch . pageX = 0 ;
7
- touch . pageY = 0 ;
8
6
touch . clientX = touch . x ;
9
7
touch . clientY = touch . y ;
10
8
} ) ;
@@ -172,17 +170,16 @@ Component({
172
170
onRender : onCanvasRender ,
173
171
// @ts -ignore
174
172
offscreenCanvas : my . createOffscreenCanvas ( ) ,
175
- useNativeClickEvent : false ,
173
+ // useNativeClickEvent: false,
176
174
isTouchEvent : ( e ) => e . type . startsWith ( 'touch' ) ,
177
175
isMouseEvent : ( e ) => e . type . startsWith ( 'mouse' ) ,
178
176
} ) ;
179
177
this . canvas = canvas ;
180
178
this . canvasEl = canvas . getCanvasEl ( ) ;
181
179
return canvas ;
182
180
} ,
183
- click ( ) {
184
- // 支付宝小程序的 tap 的 event 对象里没有点击的位置信息,拾取不到具体元素,所以关闭 useNativeClickEvent 用 g 里面的 click 实现
185
- // dispatchEvent(this.canvasEl, e, 'touchstart');
181
+ click ( e ) {
182
+ dispatchEvent ( this . canvasEl , e , 'click' ) ;
186
183
} ,
187
184
touchStart ( e ) {
188
185
dispatchEvent ( this . canvasEl , e , 'touchstart' ) ;
Original file line number Diff line number Diff line change @@ -3,8 +3,6 @@ import { Canvas } from '@antv/f-engine';
3
3
function convertTouches ( touches ) {
4
4
if ( ! touches ) return touches ;
5
5
touches . forEach ( ( touch ) => {
6
- touch . pageX = 0 ;
7
- touch . pageY = 0 ;
8
6
touch . clientX = touch . x ;
9
7
touch . clientY = touch . y ;
10
8
} ) ;
You can’t perform that action at this time.
0 commit comments