Skip to content

Commit 0434d55

Browse files
committed
release 3.4.4
1 parent 3de9fc0 commit 0434d55

File tree

4 files changed

+55
-11
lines changed

4 files changed

+55
-11
lines changed

build/zrender.js

+49-4
Original file line numberDiff line numberDiff line change
@@ -652,6 +652,50 @@ define('zrender/core/util',['require'],function(require) {
652652
return obj[primitiveKey];
653653
}
654654

655+
/**
656+
* @constructor
657+
*/
658+
function HashMap(obj) {
659+
obj && extend(this, obj);
660+
}
661+
662+
// Add prefix to avoid conflict with Object.prototype.
663+
var HASH_MAP_PREFIX = '_ec_';
664+
var HASH_MAP_PREFIX_LENGTH = 4;
665+
666+
HashMap.prototype = {
667+
constructor: HashMap,
668+
// Do not provide `has` method to avoid defining what is `has`.
669+
// (We usually treat `null` and `undefined` as the same, different
670+
// from ES6 Map).
671+
get: function (key) {
672+
return this[HASH_MAP_PREFIX + key];
673+
},
674+
set: function (key, value) {
675+
this[HASH_MAP_PREFIX + key] = value;
676+
// Comparing with invocation chaining, `return value` is more commonly
677+
// used in this case: `var someVal = map.set('a', genVal());`
678+
return value;
679+
},
680+
// Although util.each can be performed on this hashMap directly, user
681+
// should not use the exposed keys, who are prefixed.
682+
each: function (cb, context) {
683+
context !== void 0 && (cb = bind(cb, context));
684+
for (var prefixedKey in this) {
685+
this.hasOwnProperty(prefixedKey)
686+
&& cb(this[prefixedKey], prefixedKey.slice(HASH_MAP_PREFIX_LENGTH));
687+
}
688+
},
689+
// Do not use this method if performance sensitive.
690+
removeKey: function (key) {
691+
delete this[key];
692+
}
693+
};
694+
695+
function createHashMap() {
696+
return new HashMap();
697+
}
698+
655699
var util = {
656700
inherits: inherits,
657701
mixin: mixin,
@@ -682,6 +726,7 @@ define('zrender/core/util',['require'],function(require) {
682726
retrieve: retrieve,
683727
assert: assert,
684728
setAsPrimitive: setAsPrimitive,
729+
createHashMap: createHashMap,
685730
noop: function () {}
686731
};
687732
return util;
@@ -7597,7 +7642,7 @@ define('zrender/contain/text',['require','../core/util','../core/BoundingRect'],
75977642
break;
75987643
case 'insideTop':
75997644
x += width / 2;
7600-
y += distance;
7645+
y += distance + lineHeight;
76017646
textAlign = 'center';
76027647
break;
76037648
case 'insideBottom':
@@ -7607,12 +7652,12 @@ define('zrender/contain/text',['require','../core/util','../core/BoundingRect'],
76077652
break;
76087653
case 'insideTopLeft':
76097654
x += distance;
7610-
y += distance;
7655+
y += distance + lineHeight;
76117656
textAlign = 'left';
76127657
break;
76137658
case 'insideTopRight':
76147659
x += width - distance;
7615-
y += distance;
7660+
y += distance + lineHeight;
76167661
textAlign = 'right';
76177662
break;
76187663
case 'insideBottomLeft':
@@ -9441,7 +9486,7 @@ define('zrender/zrender',['require','./core/guid','./core/env','./core/util','./
94419486
/**
94429487
* @type {string}
94439488
*/
9444-
zrender.version = '3.4.3';
9489+
zrender.version = '3.4.4';
94459490

94469491
/**
94479492
* Initializing a zrender instance

build/zrender.min.js

+4-5
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": "3.4.3",
3+
"version": "3.4.4",
44
"description": "A lightweight canvas library.",
55
"keywords": [
66
"canvas",

src/zrender.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ define(function(require) {
3131
/**
3232
* @type {string}
3333
*/
34-
zrender.version = '3.4.3';
34+
zrender.version = '3.4.4';
3535

3636
/**
3737
* Initializing a zrender instance

0 commit comments

Comments
 (0)