@jiaminghi/c-render
Advanced tools
Comparing version 0.2.9 to 0.2.10
@@ -0,1 +1,7 @@ | ||
# 0.2.10-alpha (2019-05-26) | ||
### Perfect | ||
- **core:** `animationDelay` Optimize animationDelay. | ||
# 0.2.9-alpha (2019-05-24) | ||
@@ -2,0 +8,0 @@ |
@@ -190,3 +190,3 @@ import color from '@jiaminghi/color' | ||
resolve() | ||
}) | ||
}, Date.now()) | ||
}) | ||
@@ -198,5 +198,6 @@ } | ||
* @param {Function} callback Callback in animation end | ||
* @param {Number} timeStamp Time stamp of animation start | ||
* @return {Undefined} Void | ||
*/ | ||
function animation (callback) { | ||
function animation (callback, timeStamp) { | ||
const { graphs } = this | ||
@@ -210,7 +211,7 @@ | ||
graphs.forEach(graph => graph.turnNextAnimationFrame()) | ||
graphs.forEach(graph => graph.turnNextAnimationFrame(timeStamp)) | ||
this.drawAllGraph() | ||
requestAnimationFrame(animation.bind(this, callback)) | ||
requestAnimationFrame(animation.bind(this, callback, timeStamp)) | ||
} | ||
@@ -217,0 +218,0 @@ |
@@ -274,7 +274,9 @@ import Style from './style.class' | ||
*/ | ||
Graph.prototype.turnNextAnimationFrame = function () { | ||
const { animationRoot, animationKeys, animationFrameState, animationPause } = this | ||
Graph.prototype.turnNextAnimationFrame = function (timeStamp) { | ||
const { animationDelay, animationRoot, animationKeys, animationFrameState, animationPause } = this | ||
if (animationPause) return | ||
if (Date.now() - timeStamp < animationDelay) return | ||
animationRoot.forEach((root, i) => { | ||
@@ -281,0 +283,0 @@ animationKeys[i].forEach(key => { |
{ | ||
"name": "@jiaminghi/c-render", | ||
"version": "0.2.9", | ||
"version": "0.2.10", | ||
"author": "JiaMing <743192023@qq.com>", | ||
@@ -5,0 +5,0 @@ "description": "Canvas-based vector graphics rendering plugin", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
133703
1681