@antv/g-mobile
Advanced tools
Comparing version 0.0.1-beta.17 to 0.0.1-beta.18
@@ -12,5 +12,2 @@ import { Event as GraphEvent } from '@antv/g-base'; | ||
private panstartTimeStamp; | ||
private defaultScale; | ||
private currentScale; | ||
private initScale; | ||
constructor(cfg: any); | ||
@@ -17,0 +14,0 @@ _initEvent(): void; |
@@ -55,6 +55,2 @@ import Hammer, { TouchInput } from 'g6-hammerjs'; | ||
this.panstartPoint = null; | ||
// 基础的缩放比例 | ||
this.defaultScale = 1; | ||
this.currentScale = 1; | ||
this.initScale = 1; | ||
// 统一处理所有的回调 | ||
@@ -105,14 +101,8 @@ this.handleEvent = function (ev) { | ||
this.hammerRuntime.on('pinchstart pinchmove pinchend', function (e) { | ||
if (e.type == 'pinchstart') { | ||
_this.initScale = _this.currentScale || 1; | ||
} | ||
if (e.type === 'pinchend') { | ||
e.scale = _this.currentScale; | ||
_this._emitMobileEvent(e.type, e); | ||
return; | ||
} | ||
_this.currentScale = _this.initScale * e.scale; | ||
e.scale = _this.currentScale; | ||
e.srcEvent.extra = { | ||
scale: _this.currentScale, | ||
scale: e.scale, | ||
}; | ||
@@ -119,0 +109,0 @@ _this._emitMobileEvent(e.type, e); |
@@ -12,5 +12,2 @@ import { Event as GraphEvent } from '@antv/g-base'; | ||
private panstartTimeStamp; | ||
private defaultScale; | ||
private currentScale; | ||
private initScale; | ||
constructor(cfg: any); | ||
@@ -17,0 +14,0 @@ _initEvent(): void; |
@@ -57,6 +57,2 @@ "use strict"; | ||
this.panstartPoint = null; | ||
// 基础的缩放比例 | ||
this.defaultScale = 1; | ||
this.currentScale = 1; | ||
this.initScale = 1; | ||
// 统一处理所有的回调 | ||
@@ -107,14 +103,8 @@ this.handleEvent = function (ev) { | ||
this.hammerRuntime.on('pinchstart pinchmove pinchend', function (e) { | ||
if (e.type == 'pinchstart') { | ||
_this.initScale = _this.currentScale || 1; | ||
} | ||
if (e.type === 'pinchend') { | ||
e.scale = _this.currentScale; | ||
_this._emitMobileEvent(e.type, e); | ||
return; | ||
} | ||
_this.currentScale = _this.initScale * e.scale; | ||
e.scale = _this.currentScale; | ||
e.srcEvent.extra = { | ||
scale: _this.currentScale, | ||
scale: e.scale, | ||
}; | ||
@@ -121,0 +111,0 @@ _this._emitMobileEvent(e.type, e); |
{ | ||
"name": "@antv/g-mobile", | ||
"version": "0.0.1-beta.17", | ||
"version": "0.0.1-beta.18", | ||
"description": "A mobile canvas library which providing 2d", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -66,6 +66,2 @@ import Hammer, { TouchInput } from 'g6-hammerjs'; | ||
private panstartTimeStamp; | ||
// 基础的缩放比例 | ||
private defaultScale: number = 1; | ||
private currentScale: number = 1; | ||
private initScale: number = 1; | ||
@@ -127,8 +123,3 @@ constructor(cfg) { | ||
this.hammerRuntime.on('pinchstart pinchmove pinchend', (e) => { | ||
if (e.type == 'pinchstart') { | ||
this.initScale = this.currentScale || 1; | ||
} | ||
if (e.type === 'pinchend') { | ||
e.scale = this.currentScale; | ||
this._emitMobileEvent(e.type, e); | ||
@@ -138,8 +129,4 @@ return; | ||
this.currentScale = this.initScale * e.scale; | ||
e.scale = this.currentScale; | ||
e.srcEvent.extra = { | ||
scale: this.currentScale, | ||
scale: e.scale, | ||
}; | ||
@@ -146,0 +133,0 @@ this._emitMobileEvent(e.type, e); |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1961979
13113