mirror of
https://github.com/hyprwm/hyprutils.git
synced 2026-05-07 04:18:01 +02:00
thing
This commit is contained in:
parent
bacb052c56
commit
91db498b01
1 changed files with 5 additions and 3 deletions
|
|
@ -271,22 +271,24 @@ namespace Hyprutils {
|
|||
|
||||
template <class T = VarType>
|
||||
requires AnimableType<T>
|
||||
void update(bool warpNow = false) {
|
||||
SCurveStepResult update(bool warpNow = false) {
|
||||
if (warpNow || m_Value == m_Goal || !enabled()) {
|
||||
warp(true, false);
|
||||
return;
|
||||
return SCurveStepResult{.value = 1.F, .finished = true};
|
||||
}
|
||||
|
||||
const auto STEP = getCurveStep();
|
||||
if (STEP.finished) {
|
||||
warp(true, false);
|
||||
return;
|
||||
return STEP;
|
||||
}
|
||||
|
||||
const auto DELTA = m_Goal - m_Begun;
|
||||
m_Value = m_Begun + (DELTA * STEP.value);
|
||||
|
||||
onUpdate();
|
||||
|
||||
return STEP;
|
||||
}
|
||||
|
||||
AnimationContext m_Context;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue