@visactor/vrender-animate
Version:
This module provides a graph-based animation system for VRender.
25 lines (21 loc) • 1.03 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", {
value: !0
}), exports.State = void 0;
const custom_animate_1 = require("./custom-animate");
class State extends custom_animate_1.ACustomAnimate {
constructor(from, to, duration, easing, params) {
super(from, to, duration, easing, params);
}
update(end, ratio, out) {
if (this.onStart(), !this.props || !this.propKeys) return;
const easedRatio = this.easing(ratio);
this.animate.interpolateUpdateFunction ? this.animate.interpolateUpdateFunction(this.fromProps, this.props, easedRatio, this, this.target) : this.interpolateUpdateFunctions.forEach(((func, index) => {
if (!this.animate.validAttr(this.propKeys[index])) return;
const key = this.propKeys[index];
func(key, this.fromProps[key], this.props[key], easedRatio, this, this.target);
})), this.onUpdate(end, easedRatio, out), this.syncAttributeUpdate();
}
}
exports.State = State;
//# sourceMappingURL=state.js.map