Skip to content

Commit 66e17bd

Browse files
committed
release 3.4.2
1 parent d322d3f commit 66e17bd

File tree

4 files changed

+14
-11
lines changed

4 files changed

+14
-11
lines changed

build/zrender.js

+10-7
Original file line numberDiff line numberDiff line change
@@ -3126,19 +3126,21 @@ define('zrender/tool/color',['require','../core/LRU'],function(require) {
31263126
}
31273127

31283128
/**
3129-
* Map value to color. Faster than mapToColor methods because color is represented by rgba array
3129+
* Map value to color. Faster than mapToColor methods because color is represented by rgba array.
31303130
* @param {number} normalizedValue A float between 0 and 1.
31313131
* @param {Array.<Array.<number>>} colors List of rgba color array
31323132
* @param {Array.<number>} [out] Mapped gba color array
3133-
* @return {Array.<number>}
3133+
* @return {Array.<number>} will be null/undefined if input illegal.
31343134
*/
31353135
function fastMapToColor(normalizedValue, colors, out) {
3136-
out = out || [0, 0, 0, 0];
31373136
if (!(colors && colors.length)
31383137
|| !(normalizedValue >= 0 && normalizedValue <= 1)
31393138
) {
3140-
return out;
3139+
return;
31413140
}
3141+
3142+
out = out || [];
3143+
31423144
var value = normalizedValue * (colors.length - 1);
31433145
var leftIndex = Math.floor(value);
31443146
var rightIndex = Math.ceil(value);
@@ -3149,6 +3151,7 @@ define('zrender/tool/color',['require','../core/LRU'],function(require) {
31493151
out[1] = clampCssByte(lerp(leftColor[1], rightColor[1], dv));
31503152
out[2] = clampCssByte(lerp(leftColor[2], rightColor[2], dv));
31513153
out[3] = clampCssFloat(lerp(leftColor[3], rightColor[3], dv));
3154+
31523155
return out;
31533156
}
31543157
/**
@@ -3230,12 +3233,12 @@ define('zrender/tool/color',['require','../core/LRU'],function(require) {
32303233
}
32313234

32323235
/**
3233-
* @param {Array.<string>} colors Color list.
3236+
* @param {Array.<number>} arrColor like [12,33,44,0.4]
32343237
* @param {string} type 'rgba', 'hsva', ...
32353238
* @return {string} Result color. (If input illegal, return undefined).
32363239
*/
32373240
function stringify(arrColor, type) {
3238-
if (!arrColor) {
3241+
if (!arrColor || !arrColor.length) {
32393242
return;
32403243
}
32413244
var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];
@@ -9426,7 +9429,7 @@ define('zrender/zrender',['require','./core/guid','./core/env','./core/util','./
94269429
/**
94279430
* @type {string}
94289431
*/
9429-
zrender.version = '3.4.1';
9432+
zrender.version = '3.4.2';
94309433

94319434
/**
94329435
* Initializing a zrender instance

build/zrender.min.js

+2-2
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.1",
3+
"version": "3.4.2",
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.1';
34+
zrender.version = '3.4.2';
3535

3636
/**
3737
* Initializing a zrender instance

0 commit comments

Comments
 (0)