|
118 | 118 | args[_i] = arguments[_i];
|
119 | 119 | }
|
120 | 120 | if (typeof console !== 'undefined') {
|
121 |
| - console.error.apply(args); |
| 121 | + console.error.apply(console, args); |
122 | 122 | }
|
123 | 123 | }
|
124 | 124 | function clone(source) {
|
|
3144 | 3144 | this._clip = null;
|
3145 | 3145 | this._target = target;
|
3146 | 3146 | this._loop = loop;
|
3147 |
| - if (loop) { |
| 3147 | + if (loop && additiveTo) { |
3148 | 3148 | logError('Can\' use additive animation on looped animation.');
|
3149 | 3149 | return;
|
3150 | 3150 | }
|
|
12882 | 12882 | };
|
12883 | 12883 | ZRender.prototype.refreshHoverImmediately = function () {
|
12884 | 12884 | this._needsRefreshHover = false;
|
12885 |
| - if (this.painter.refreshHover) { |
| 12885 | + if (this.painter.refreshHover && this.painter.getType() === 'canvas') { |
12886 | 12886 | this.painter.refreshHover();
|
12887 | 12887 | }
|
12888 | 12888 | };
|
|
12967 | 12967 | function registerPainter(name, Ctor) {
|
12968 | 12968 | painterCtors[name] = Ctor;
|
12969 | 12969 | }
|
12970 |
| - var version = '5.0.0'; |
| 12970 | + var version = '5.0.1'; |
12971 | 12971 |
|
12972 | 12972 | function createLinearGradient(ctx, obj, rect) {
|
12973 | 12973 | var x = obj.x == null ? 0 : obj.x;
|
|
15187 | 15187 | function isRadialGradient(value) {
|
15188 | 15188 | return value.type === 'radial';
|
15189 | 15189 | }
|
| 15190 | + function isGradient(value) { |
| 15191 | + return value && (value.type === 'linear' |
| 15192 | + || value.type === 'radial'); |
| 15193 | + } |
15190 | 15194 | var GradientManager = (function (_super) {
|
15191 | 15195 | __extends(GradientManager, _super);
|
15192 | 15196 | function GradientManager(zrId, svgRoot) {
|
|
15197 | 15201 | var that_1 = this;
|
15198 | 15202 | each(['fill', 'stroke'], function (fillOrStroke) {
|
15199 | 15203 | var value = displayable.style[fillOrStroke];
|
15200 |
| - if (value |
15201 |
| - && (value.type === 'linear' |
15202 |
| - || value.type === 'radial')) { |
| 15204 | + if (isGradient(value)) { |
15203 | 15205 | var gradient = value;
|
15204 | 15206 | var defs = that_1.getDefs(true);
|
15205 | 15207 | var dom = void 0;
|
|
15239 | 15241 | return dom;
|
15240 | 15242 | };
|
15241 | 15243 | GradientManager.prototype.update = function (gradient) {
|
| 15244 | + if (!isGradient(gradient)) { |
| 15245 | + return; |
| 15246 | + } |
15242 | 15247 | var that = this;
|
15243 | 15248 | this.doUpdate(gradient, function () {
|
15244 | 15249 | var dom = gradient.__dom;
|
|
15313 | 15318 | return GradientManager;
|
15314 | 15319 | }(Definable));
|
15315 | 15320 |
|
| 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 | + |
15316 | 15362 | function isPattern(value) {
|
15317 | 15363 | return value && (!!value.image || !!value.svgElement);
|
15318 | 15364 | }
|
|
15440 | 15486 | _super.prototype.markDomUsed.call(this, patternDomMap.get(displayable.style.fill));
|
15441 | 15487 | }
|
15442 | 15488 | 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)); |
15444 | 15490 | }
|
15445 | 15491 | }
|
15446 | 15492 | };
|
|
0 commit comments