qs: fix notification anim framerate tie
This commit is contained in:
parent
2fe7a3954e
commit
fd6088af37
1 changed files with 5 additions and 5 deletions
|
@ -181,11 +181,11 @@ Item {
|
|||
|
||||
FrameAnimation {
|
||||
function dampingVelocity(currentVelocity, delta) {
|
||||
const spring = 1.0;
|
||||
const damping = 0.1;
|
||||
const spring = 150.0;
|
||||
const damping = 20.0;
|
||||
const springForce = spring * delta;
|
||||
const dampingForce = -damping * currentVelocity;
|
||||
return currentVelocity + (springForce + dampingForce);
|
||||
return springForce + dampingForce;
|
||||
}
|
||||
|
||||
running: display.state != FlickableNotification.Inert
|
||||
|
@ -215,8 +215,8 @@ Item {
|
|||
const deltaX = 0 - display.displayX;
|
||||
const deltaY = root.padding - display.displayY;
|
||||
|
||||
display.velocityX = dampingVelocity(display.velocityX, deltaX);
|
||||
display.velocityY = dampingVelocity(display.velocityY, deltaY);
|
||||
display.velocityX += dampingVelocity(display.velocityX, deltaX) * frameTime;
|
||||
display.velocityY += dampingVelocity(display.velocityY, deltaY) * frameTime;
|
||||
|
||||
if (Math.abs(display.velocityX) < 0.01 && Math.abs(deltaX) < 1
|
||||
&& Math.abs(display.velocityY) < 0.01 && Math.abs(deltaY) < 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue