@@ -5613,7 +5613,10 @@ define('zrender/core/event',['require','../mixin/Eventful','./env'],function(req
5613
5613
return el . getBoundingClientRect ? el . getBoundingClientRect ( ) : { left : 0 , top : 0 } ;
5614
5614
}
5615
5615
5616
- function clientToLocal ( el , e , out ) {
5616
+ // `calculate` is optional, default false
5617
+ function clientToLocal ( el , e , out , calculate ) {
5618
+ out = out || { } ;
5619
+
5617
5620
// According to the W3C Working Draft, offsetX and offsetY should be relative
5618
5621
// to the padding edge of the target element. The only browser using this convention
5619
5622
// is IE. Webkit uses the border edge, Opera uses the content edge, and FireFox does
@@ -5625,8 +5628,7 @@ define('zrender/core/event',['require','../mixin/Eventful','./env'],function(req
5625
5628
// When mousemove event triggered on ec tooltip, target is not zr painter.dom, and
5626
5629
// offsetX/Y is relative to e.target, where the calculation of zrX/Y via offsetX/Y
5627
5630
// is too complex. So css-transfrom dont support in this case temporarily.
5628
-
5629
- if ( ! e . currentTarget || el !== e . currentTarget ) {
5631
+ if ( calculate ) {
5630
5632
defaultGetZrXY ( el , e , out ) ;
5631
5633
}
5632
5634
// Caution: In FireFox, layerX/layerY Mouse position relative to the closest positioned
@@ -5656,15 +5658,15 @@ define('zrender/core/event',['require','../mixin/Eventful','./env'],function(req
5656
5658
function defaultGetZrXY ( el , e , out ) {
5657
5659
// This well-known method below does not support css transform.
5658
5660
var box = getBoundingClientRect ( el ) ;
5659
- out = out || { } ;
5660
5661
out . zrX = e . clientX - box . left ;
5661
5662
out . zrY = e . clientY - box . top ;
5662
5663
}
5663
5664
5664
5665
/**
5665
- * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标
5666
+ * 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标.
5667
+ * `calculate` is optional, default false.
5666
5668
*/
5667
- function normalizeEvent ( el , e ) {
5669
+ function normalizeEvent ( el , e , calculate ) {
5668
5670
5669
5671
e = e || window . event ;
5670
5672
@@ -5676,14 +5678,14 @@ define('zrender/core/event',['require','../mixin/Eventful','./env'],function(req
5676
5678
var isTouch = eventType && eventType . indexOf ( 'touch' ) >= 0 ;
5677
5679
5678
5680
if ( ! isTouch ) {
5679
- clientToLocal ( el , e , e ) ;
5681
+ clientToLocal ( el , e , e , calculate ) ;
5680
5682
e . zrDelta = ( e . wheelDelta ) ? e . wheelDelta / 120 : - ( e . detail || 0 ) / 3 ;
5681
5683
}
5682
5684
else {
5683
5685
var touch = eventType != 'touchend'
5684
5686
? e . targetTouches [ 0 ]
5685
5687
: e . changedTouches [ 0 ] ;
5686
- touch && clientToLocal ( el , touch , e ) ;
5688
+ touch && clientToLocal ( el , touch , e , calculate ) ;
5687
5689
}
5688
5690
5689
5691
return e ;
@@ -6049,7 +6051,7 @@ define('zrender/core/GestureMgr',['require','./event'],function(require) {
6049
6051
6050
6052
for ( var i = 0 , len = touches . length ; i < len ; i ++ ) {
6051
6053
var touch = touches [ i ] ;
6052
- var pos = eventUtil . clientToLocal ( root , touch ) ;
6054
+ var pos = eventUtil . clientToLocal ( root , touch , { } ) ;
6053
6055
trackItem . points . push ( [ pos . zrX , pos . zrY ] ) ;
6054
6056
trackItem . touches . push ( touch ) ;
6055
6057
}
@@ -9064,7 +9066,7 @@ define('zrender/zrender',['require','./core/guid','./core/env','./Handler','./St
9064
9066
/**
9065
9067
* @type {string }
9066
9068
*/
9067
- zrender . version = '3.2.0 ' ;
9069
+ zrender . version = '3.2.1 ' ;
9068
9070
9069
9071
/**
9070
9072
* Initializing a zrender instance
0 commit comments