Animation overshoot: support negative values
This commit is contained in:
parent
88fb71ff34
commit
bf1e36031f
|
@ -16,7 +16,7 @@ HFlickableColumnPage {
|
|||
running: true
|
||||
from: 0
|
||||
to: 1
|
||||
overshoot: 3
|
||||
overshoot: 2
|
||||
}
|
||||
|
||||
Behavior on implicitWidth { HNumberAnimation {} }
|
||||
|
|
|
@ -52,7 +52,7 @@ CheckBox {
|
|||
|
||||
Behavior on scale {
|
||||
HNumberAnimation {
|
||||
overshoot: 4
|
||||
overshoot: 3
|
||||
easing.type: Easing.InOutBack
|
||||
factor: 0.5
|
||||
}
|
||||
|
|
|
@ -4,10 +4,17 @@ import QtQuick 2.12
|
|||
|
||||
NumberAnimation {
|
||||
property real factor: 1.0
|
||||
property real overshoot: 1.0
|
||||
property real overshoot: 0.0
|
||||
|
||||
|
||||
duration: theme.animationDuration * Math.max(overshoot / 1.7, 1.0) * factor
|
||||
easing.type: overshoot > 1 ? Easing.OutBack : Easing.Linear
|
||||
duration:
|
||||
theme.animationDuration *
|
||||
Math.max((1 + Math.abs(overshoot)) / 1.7, 1.0) * factor
|
||||
|
||||
easing.type:
|
||||
overshoot > 0 ? Easing.OutBack :
|
||||
overshoot < 0 ? Easing.InBack :
|
||||
Easing.Linear
|
||||
|
||||
easing.overshoot: overshoot
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ Popup {
|
|||
y: (parent.height - height) / 2
|
||||
|
||||
enter: Transition {
|
||||
HNumberAnimation { property: "scale"; from: 0; to: 1; overshoot: 4 }
|
||||
HNumberAnimation { property: "scale"; from: 0; to: 1; overshoot: 3 }
|
||||
}
|
||||
|
||||
exit: Transition {
|
||||
|
|
|
@ -22,7 +22,7 @@ HPage {
|
|||
running: true
|
||||
from: 0
|
||||
to: 1
|
||||
overshoot: 3
|
||||
overshoot: 2
|
||||
}
|
||||
|
||||
Behavior on implicitWidth { HNumberAnimation {} }
|
||||
|
|
|
@ -94,6 +94,6 @@ ApplicationWindow {
|
|||
scale: py.ready ? 1 : 0.5
|
||||
source: py.ready ? (Qt.application.arguments[1] || "UI.qml") : ""
|
||||
|
||||
Behavior on scale { HNumberAnimation { overshoot: 5; factor: 1.2 } }
|
||||
Behavior on scale { HNumberAnimation { overshoot: 3; factor: 1.2 } }
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user