mirror of
https://github.com/konvajs/konva.git
synced 2025-06-28 00:14:29 +08:00
fixed transition bug related to frame.timeDiff
This commit is contained in:
parent
70fe63b2b6
commit
588b65a849
7
dist/kinetic-core.js
vendored
7
dist/kinetic-core.js
vendored
@ -3,7 +3,7 @@
|
|||||||
* http://www.kineticjs.com/
|
* http://www.kineticjs.com/
|
||||||
* Copyright 2012, Eric Rowell
|
* Copyright 2012, Eric Rowell
|
||||||
* Licensed under the MIT or GPL Version 2 licenses.
|
* Licensed under the MIT or GPL Version 2 licenses.
|
||||||
* Date: Mar 18 2012
|
* Date: Mar 19 2012
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 - 2012 by Eric Rowell
|
* Copyright (C) 2011 - 2012 by Eric Rowell
|
||||||
*
|
*
|
||||||
@ -75,6 +75,8 @@ Kinetic.GlobalObject = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.frame.lastTime = 0;
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
_endTransition: function() {
|
_endTransition: function() {
|
||||||
@ -196,9 +198,6 @@ Kinetic.GlobalObject = {
|
|||||||
if(this._isaCanvasAnimating()) {
|
if(this._isaCanvasAnimating()) {
|
||||||
that._animationLoop();
|
that._animationLoop();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
this.frame.lastTime = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
4
dist/kinetic-core.min.js
vendored
4
dist/kinetic-core.min.js
vendored
File diff suppressed because one or more lines are too long
@ -47,6 +47,8 @@ Kinetic.GlobalObject = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.frame.lastTime = 0;
|
||||||
return false;
|
return false;
|
||||||
},
|
},
|
||||||
_endTransition: function() {
|
_endTransition: function() {
|
||||||
@ -168,9 +170,6 @@ Kinetic.GlobalObject = {
|
|||||||
if(this._isaCanvasAnimating()) {
|
if(this._isaCanvasAnimating()) {
|
||||||
that._animationLoop();
|
that._animationLoop();
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
this.frame.lastTime = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -81,6 +81,47 @@ Test.prototype.tests = {
|
|||||||
stage.stop();
|
stage.stop();
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
|
'TRANSITION - hover transition': function(containerId) {
|
||||||
|
var stage = new Kinetic.Stage(containerId, 578, 200);
|
||||||
|
var layer = new Kinetic.Layer();
|
||||||
|
var rect = new Kinetic.Rect({
|
||||||
|
x: stage.width / 2 - 50,
|
||||||
|
y: stage.height / 2 - 25,
|
||||||
|
width: 100,
|
||||||
|
height: 50,
|
||||||
|
fill: 'green',
|
||||||
|
stroke: 'black',
|
||||||
|
strokeWidth: 4,
|
||||||
|
centerOffset: {
|
||||||
|
x: 50,
|
||||||
|
y: 25
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
rect.on("mouseover", function() {
|
||||||
|
this.transitionTo({
|
||||||
|
scale: {
|
||||||
|
x: 1.3,
|
||||||
|
y: 1.3
|
||||||
|
},
|
||||||
|
duration: 0.3
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
rect.on("mouseout", function() {
|
||||||
|
this.transitionTo({
|
||||||
|
scale: {
|
||||||
|
x: 1,
|
||||||
|
y: 1
|
||||||
|
},
|
||||||
|
duration: 0.3
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
layer.add(rect);
|
||||||
|
stage.add(layer);
|
||||||
|
|
||||||
|
},
|
||||||
'EVENTS - mousedown mouseup mouseover mouseout click dblclick / touchstart touchend dbltap': function(containerId) {
|
'EVENTS - mousedown mouseup mouseover mouseout click dblclick / touchstart touchend dbltap': function(containerId) {
|
||||||
var stage = new Kinetic.Stage(containerId, 578, 200);
|
var stage = new Kinetic.Stage(containerId, 578, 200);
|
||||||
var layer = new Kinetic.Layer();
|
var layer = new Kinetic.Layer();
|
||||||
@ -467,13 +508,10 @@ Test.prototype.tests = {
|
|||||||
var layer = new Kinetic.Layer();
|
var layer = new Kinetic.Layer();
|
||||||
var group = new Kinetic.Group();
|
var group = new Kinetic.Group();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
group.on('click', function() {
|
group.on('click', function() {
|
||||||
log('click group');
|
log('click group');
|
||||||
//console.log(this);
|
//console.log(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
var redCircle = new Kinetic.Circle({
|
var redCircle = new Kinetic.Circle({
|
||||||
x: stage.width / 2,
|
x: stage.width / 2,
|
||||||
y: stage.height / 2,
|
y: stage.height / 2,
|
||||||
@ -509,7 +547,6 @@ Test.prototype.tests = {
|
|||||||
log('mousemove group');
|
log('mousemove group');
|
||||||
//console.log(this);
|
//console.log(this);
|
||||||
});
|
});
|
||||||
|
|
||||||
var redCircle = new Kinetic.Circle({
|
var redCircle = new Kinetic.Circle({
|
||||||
x: stage.width / 2,
|
x: stage.width / 2,
|
||||||
y: stage.height / 2,
|
y: stage.height / 2,
|
||||||
@ -548,7 +585,6 @@ Test.prototype.tests = {
|
|||||||
group.on('mouseout', function() {
|
group.on('mouseout', function() {
|
||||||
log('mouseout group');
|
log('mouseout group');
|
||||||
});
|
});
|
||||||
|
|
||||||
var redCircle = new Kinetic.Circle({
|
var redCircle = new Kinetic.Circle({
|
||||||
x: stage.width / 2,
|
x: stage.width / 2,
|
||||||
y: stage.height / 2,
|
y: stage.height / 2,
|
||||||
|
Loading…
Reference in New Issue
Block a user