将kineticjs 4.5.3升级到5.0.1后,补间播放功能不起作用。 我的功能是
ZoomOnPoint: function (pos, delta, options) {
options || (options = {});
var viewport = gstage.getPosition();
var scale1 = gstage.getScale().x;
var scale2 = scale1 + delta;
if ((scale1 < 2 && delta > 0) || (scale1 > 0.5 && delta < 0)) {
if (options == true) {
}
else {
// can't see the animation
var tween = new Kinetic.Tween({
node: gstage,
x: -((pos.x - viewport.x) * (scale2 / scale1)) + pos.x,
y: -((pos.y - viewport.y) * (scale2 / scale1)) + pos.y,
duration: 0.5,
easing: Kinetic.Easings.StrongEaseOut,
scaleX: scale2,
scaleY: scale2,
onFinish: function () {
this.destroy();
}
});
tween.play();
}
}
输入参数x,y scaleX,scaleY与4.5.3中的相同。任何人都可以给我一些想法? 感谢