mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
WindowServer: Change animation time to duration
The time interval for animations is most often described as `duration` in animation contexts and the `WindowServer::Animation` class should reflect that.
This commit is contained in:
parent
0cb937416b
commit
b12e5de047
3 changed files with 8 additions and 8 deletions
|
@ -20,9 +20,9 @@ Animation::~Animation()
|
|||
Compositor::the().unregister_animation({}, *this);
|
||||
}
|
||||
|
||||
void Animation::set_length(int length_in_ms)
|
||||
void Animation::set_duration(int duration_in_ms)
|
||||
{
|
||||
m_length = length_in_ms;
|
||||
m_duration = duration_in_ms;
|
||||
}
|
||||
|
||||
void Animation::start()
|
||||
|
@ -41,7 +41,7 @@ void Animation::stop()
|
|||
void Animation::update(Badge<Compositor>, Gfx::Painter& painter, Screen& screen, Gfx::DisjointRectSet& flush_rects)
|
||||
{
|
||||
int elapsed_ms = m_timer.elapsed();
|
||||
float progress = min((float)elapsed_ms / (float)m_length, 1.0f);
|
||||
float progress = min((float)elapsed_ms / (float)m_duration, 1.0f);
|
||||
|
||||
if (on_update)
|
||||
on_update(progress, painter, screen, flush_rects);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue