Skip to content

Commit bbb230d

Browse files
authoredNov 20, 2020
Merge pull request #666 from ecomfe/release-next
release: 5.0.1
2 parents 6787bd4 + c9929ca commit bbb230d

File tree

5 files changed

+58
-12
lines changed

5 files changed

+58
-12
lines changed
 

‎dist/zrender.js

+54-8
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@
118118
args[_i] = arguments[_i];
119119
}
120120
if (typeof console !== 'undefined') {
121-
console.error.apply(args);
121+
console.error.apply(console, args);
122122
}
123123
}
124124
function clone(source) {
@@ -3144,7 +3144,7 @@
31443144
this._clip = null;
31453145
this._target = target;
31463146
this._loop = loop;
3147-
if (loop) {
3147+
if (loop && additiveTo) {
31483148
logError('Can\' use additive animation on looped animation.');
31493149
return;
31503150
}
@@ -12882,7 +12882,7 @@
1288212882
};
1288312883
ZRender.prototype.refreshHoverImmediately = function () {
1288412884
this._needsRefreshHover = false;
12885-
if (this.painter.refreshHover) {
12885+
if (this.painter.refreshHover && this.painter.getType() === 'canvas') {
1288612886
this.painter.refreshHover();
1288712887
}
1288812888
};
@@ -12967,7 +12967,7 @@
1296712967
function registerPainter(name, Ctor) {
1296812968
painterCtors[name] = Ctor;
1296912969
}
12970-
var version = '5.0.0';
12970+
var version = '5.0.1';
1297112971

1297212972
function createLinearGradient(ctx, obj, rect) {
1297312973
var x = obj.x == null ? 0 : obj.x;
@@ -15187,6 +15187,10 @@
1518715187
function isRadialGradient(value) {
1518815188
return value.type === 'radial';
1518915189
}
15190+
function isGradient(value) {
15191+
return value && (value.type === 'linear'
15192+
|| value.type === 'radial');
15193+
}
1519015194
var GradientManager = (function (_super) {
1519115195
__extends(GradientManager, _super);
1519215196
function GradientManager(zrId, svgRoot) {
@@ -15197,9 +15201,7 @@
1519715201
var that_1 = this;
1519815202
each(['fill', 'stroke'], function (fillOrStroke) {
1519915203
var value = displayable.style[fillOrStroke];
15200-
if (value
15201-
&& (value.type === 'linear'
15202-
|| value.type === 'radial')) {
15204+
if (isGradient(value)) {
1520315205
var gradient = value;
1520415206
var defs = that_1.getDefs(true);
1520515207
var dom = void 0;
@@ -15239,6 +15241,9 @@
1523915241
return dom;
1524015242
};
1524115243
GradientManager.prototype.update = function (gradient) {
15244+
if (!isGradient(gradient)) {
15245+
return;
15246+
}
1524215247
var that = this;
1524315248
this.doUpdate(gradient, function () {
1524415249
var dom = gradient.__dom;
@@ -15313,6 +15318,47 @@
1531315318
return GradientManager;
1531415319
}(Definable));
1531515320

15321+
var wmUniqueIndex = Math.round(Math.random() * 9);
15322+
var WeakMap = (function () {
15323+
function WeakMap() {
15324+
this._id = '__ec_inner_' + wmUniqueIndex++;
15325+
}
15326+
WeakMap.prototype.get = function (key) {
15327+
return this._guard(key)[this._id];
15328+
};
15329+
WeakMap.prototype.set = function (key, value) {
15330+
var target = this._guard(key);
15331+
if (typeof Object.defineProperty === 'function') {
15332+
Object.defineProperty(target, this._id, {
15333+
value: value,
15334+
enumerable: false,
15335+
configurable: true
15336+
});
15337+
}
15338+
else {
15339+
target[this._id] = value;
15340+
}
15341+
return this;
15342+
};
15343+
WeakMap.prototype["delete"] = function (key) {
15344+
if (this.has(key)) {
15345+
delete this._guard(key)[this._id];
15346+
return true;
15347+
}
15348+
return false;
15349+
};
15350+
WeakMap.prototype.has = function (key) {
15351+
return !!this._guard(key)[this._id];
15352+
};
15353+
WeakMap.prototype._guard = function (key) {
15354+
if (key !== Object(key)) {
15355+
throw TypeError('Value of WeakMap is not a non-null object.');
15356+
}
15357+
return key;
15358+
};
15359+
return WeakMap;
15360+
}());
15361+
1531615362
function isPattern(value) {
1531715363
return value && (!!value.image || !!value.svgElement);
1531815364
}
@@ -15440,7 +15486,7 @@
1544015486
_super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));
1544115487
}
1544215488
if (isPattern(displayable.style.stroke)) {
15443-
_super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));
15489+
_super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.stroke));
1544415490
}
1544515491
}
1544615492
};

‎dist/zrender.js.map

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎dist/zrender.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "zrender",
3-
"version": "5.0.0",
3+
"version": "5.0.1",
44
"description": "A lightweight canvas library.",
55
"keywords": [
66
"canvas",

‎src/zrender.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -520,7 +520,7 @@ export function registerPainter(name: string, Ctor: PainterBaseCtor) {
520520
/**
521521
* @type {string}
522522
*/
523-
export const version = '5.0.0';
523+
export const version = '5.0.1';
524524

525525

526526
export interface ZRenderType extends ZRender {};

0 commit comments

Comments
 (0)
Please sign in to comment.