mirror of
https://github.com/konvajs/konva.git
synced 2025-11-24 08:46:44 +08:00
migrated old manual test to new testing system. fixed tweening issues
This commit is contained in:
@@ -33,4 +33,54 @@ suite('Manual', function() {
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
// ======================================================
|
||||
test('tween spline', function() {
|
||||
var stage = addStage();
|
||||
var layer = new Kinetic.Layer();
|
||||
|
||||
var spline = new Kinetic.Line({
|
||||
points: [
|
||||
73, 160,
|
||||
340, 23,
|
||||
500, 109,
|
||||
300, 109
|
||||
],
|
||||
stroke: 'blue',
|
||||
strokeWidth: 10,
|
||||
lineCap: 'round',
|
||||
lineJoin: 'round',
|
||||
draggable: true,
|
||||
tension: 1
|
||||
});
|
||||
|
||||
layer.add(spline);
|
||||
stage.add(layer);
|
||||
|
||||
var tween = new Kinetic.Tween({
|
||||
node: spline,
|
||||
duration: 1,
|
||||
//x: 100,
|
||||
|
||||
points: [
|
||||
200, 160,
|
||||
200, 23,
|
||||
500, 109,
|
||||
100, 10
|
||||
],
|
||||
easing: Kinetic.Easings.BackEaseOut,
|
||||
yoyo: true
|
||||
});
|
||||
|
||||
// stage.getContent().addEventListener('mouseover', function() {
|
||||
// tween.play();
|
||||
// });
|
||||
|
||||
// stage.getContent().addEventListener('mouseout', function() {
|
||||
// tween.reverse();
|
||||
// });
|
||||
|
||||
tween.play();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user