Skip to content

Commit

Permalink
release 3.4.2
Browse files Browse the repository at this point in the history
  • Loading branch information
100pah committed Apr 5, 2017
1 parent d322d3f commit 66e17bd
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 11 deletions.
17 changes: 10 additions & 7 deletions build/zrender.js
Original file line number Diff line number Diff line change
Expand Up @@ -3126,19 +3126,21 @@ define('zrender/tool/color',['require','../core/LRU'],function(require) {
}

/**
* Map value to color. Faster than mapToColor methods because color is represented by rgba array
* Map value to color. Faster than mapToColor methods because color is represented by rgba array.
* @param {number} normalizedValue A float between 0 and 1.
* @param {Array.<Array.<number>>} colors List of rgba color array
* @param {Array.<number>} [out] Mapped gba color array
* @return {Array.<number>}
* @return {Array.<number>} will be null/undefined if input illegal.
*/
function fastMapToColor(normalizedValue, colors, out) {
out = out || [0, 0, 0, 0];
if (!(colors && colors.length)
|| !(normalizedValue >= 0 && normalizedValue <= 1)
) {
return out;
return;
}

out = out || [];

var value = normalizedValue * (colors.length - 1);
var leftIndex = Math.floor(value);
var rightIndex = Math.ceil(value);
Expand All @@ -3149,6 +3151,7 @@ define('zrender/tool/color',['require','../core/LRU'],function(require) {
out[1] = clampCssByte(lerp(leftColor[1], rightColor[1], dv));
out[2] = clampCssByte(lerp(leftColor[2], rightColor[2], dv));
out[3] = clampCssFloat(lerp(leftColor[3], rightColor[3], dv));

return out;
}
/**
Expand Down Expand Up @@ -3230,12 +3233,12 @@ define('zrender/tool/color',['require','../core/LRU'],function(require) {
}

/**
* @param {Array.<string>} colors Color list.
* @param {Array.<number>} arrColor like [12,33,44,0.4]
* @param {string} type 'rgba', 'hsva', ...
* @return {string} Result color. (If input illegal, return undefined).
*/
function stringify(arrColor, type) {
if (!arrColor) {
if (!arrColor || !arrColor.length) {
return;
}
var colorStr = arrColor[0] + ',' + arrColor[1] + ',' + arrColor[2];
Expand Down Expand Up @@ -9426,7 +9429,7 @@ define('zrender/zrender',['require','./core/guid','./core/env','./core/util','./
/**
* @type {string}
*/
zrender.version = '3.4.1';
zrender.version = '3.4.2';

/**
* Initializing a zrender instance
Expand Down
4 changes: 2 additions & 2 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.4.1",
"version": "3.4.2",
"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 @@ -31,7 +31,7 @@ define(function(require) {
/**
* @type {string}
*/
zrender.version = '3.4.1';
zrender.version = '3.4.2';

/**
* Initializing a zrender instance
Expand Down

0 comments on commit 66e17bd

Please sign in to comment.