Skip to content

Commit

Permalink
Dump 3.2.1
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Nov 3, 2016
1 parent 8c6e651 commit 1e6efe5
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
22 changes: 12 additions & 10 deletions build/zrender.js
Original file line number Diff line number Diff line change
Expand Up @@ -5613,7 +5613,10 @@ define('zrender/core/event',['require','../mixin/Eventful','./env'],function(req
return el.getBoundingClientRect ? el.getBoundingClientRect() : {left: 0, top: 0};
}

function clientToLocal(el, e, out) {
// `calculate` is optional, default false
function clientToLocal(el, e, out, calculate) {
out = out || {};

// According to the W3C Working Draft, offsetX and offsetY should be relative
// to the padding edge of the target element. The only browser using this convention
// is IE. Webkit uses the border edge, Opera uses the content edge, and FireFox does
Expand All @@ -5625,8 +5628,7 @@ define('zrender/core/event',['require','../mixin/Eventful','./env'],function(req
// When mousemove event triggered on ec tooltip, target is not zr painter.dom, and
// offsetX/Y is relative to e.target, where the calculation of zrX/Y via offsetX/Y
// is too complex. So css-transfrom dont support in this case temporarily.

if (!e.currentTarget || el !== e.currentTarget) {
if (calculate) {
defaultGetZrXY(el, e, out);
}
// Caution: In FireFox, layerX/layerY Mouse position relative to the closest positioned
Expand Down Expand Up @@ -5656,15 +5658,15 @@ define('zrender/core/event',['require','../mixin/Eventful','./env'],function(req
function defaultGetZrXY(el, e, out) {
// This well-known method below does not support css transform.
var box = getBoundingClientRect(el);
out = out || {};
out.zrX = e.clientX - box.left;
out.zrY = e.clientY - box.top;
}

/**
* 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标
* 如果存在第三方嵌入的一些dom触发的事件,或touch事件,需要转换一下事件坐标.
* `calculate` is optional, default false.
*/
function normalizeEvent(el, e) {
function normalizeEvent(el, e, calculate) {

e = e || window.event;

Expand All @@ -5676,14 +5678,14 @@ define('zrender/core/event',['require','../mixin/Eventful','./env'],function(req
var isTouch = eventType && eventType.indexOf('touch') >= 0;

if (!isTouch) {
clientToLocal(el, e, e);
clientToLocal(el, e, e, calculate);
e.zrDelta = (e.wheelDelta) ? e.wheelDelta / 120 : -(e.detail || 0) / 3;
}
else {
var touch = eventType != 'touchend'
? e.targetTouches[0]
: e.changedTouches[0];
touch && clientToLocal(el, touch, e);
touch && clientToLocal(el, touch, e, calculate);
}

return e;
Expand Down Expand Up @@ -6049,7 +6051,7 @@ define('zrender/core/GestureMgr',['require','./event'],function(require) {

for (var i = 0, len = touches.length; i < len; i++) {
var touch = touches[i];
var pos = eventUtil.clientToLocal(root, touch);
var pos = eventUtil.clientToLocal(root, touch, {});
trackItem.points.push([pos.zrX, pos.zrY]);
trackItem.touches.push(touch);
}
Expand Down Expand Up @@ -9064,7 +9066,7 @@ define('zrender/zrender',['require','./core/guid','./core/env','./Handler','./St
/**
* @type {string}
*/
zrender.version = '3.2.0';
zrender.version = '3.2.1';

/**
* Initializing a zrender instance
Expand Down
8 changes: 4 additions & 4 deletions build/zrender.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "zrender",
"version": "3.2.0",
"version": "3.2.1",
"description": "A lightweight canvas library.",
"keywords": [
"canvas",
Expand Down
2 changes: 1 addition & 1 deletion src/zrender.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ define(function(require) {
/**
* @type {string}
*/
zrender.version = '3.2.0';
zrender.version = '3.2.1';

/**
* Initializing a zrender instance
Expand Down

0 comments on commit 1e6efe5

Please sign in to comment.