jmgraph 3.2.10 → 3.2.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
package/src/core/jmUtils.js
CHANGED
|
@@ -317,12 +317,12 @@ export default class jmUtils {
|
|
|
317
317
|
*/
|
|
318
318
|
static getEventPosition (evt, scale) {
|
|
319
319
|
evt = evt || event;
|
|
320
|
-
|
|
320
|
+
const isWXMiniApp = evt.isWXMiniApp;
|
|
321
321
|
let isTouch = false;
|
|
322
322
|
let touches = evt.changedTouches || evt.targetTouches || evt.touches;
|
|
323
323
|
let target = evt.target || evt.srcElement;
|
|
324
324
|
if(touches && touches.length) {
|
|
325
|
-
evt = touches[0];//兼容touch事件
|
|
325
|
+
evt = touches[0];//兼容touch事件
|
|
326
326
|
if(!evt.target) evt.target = target;
|
|
327
327
|
isTouch = true;
|
|
328
328
|
}
|
|
@@ -335,7 +335,7 @@ export default class jmUtils {
|
|
|
335
335
|
let oy = evt.offsetY;
|
|
336
336
|
if(typeof ox === 'undefined' && typeof oy === 'undefined') {
|
|
337
337
|
// 小程序下取x,y就是它的相对坐标
|
|
338
|
-
if(
|
|
338
|
+
if(isWXMiniApp) {
|
|
339
339
|
ox = evt.x;
|
|
340
340
|
oy = evt.y;
|
|
341
341
|
}
|
|
@@ -365,7 +365,8 @@ export default class jmUtils {
|
|
|
365
365
|
x: ox,
|
|
366
366
|
y: oy,
|
|
367
367
|
isTouch: isTouch,
|
|
368
|
-
touches
|
|
368
|
+
touches,
|
|
369
|
+
isWXMiniApp
|
|
369
370
|
};
|
|
370
371
|
}
|
|
371
372
|
|