rename animation => transition
This commit is contained in:
@@ -185,18 +185,18 @@ void Raster::bind(bool linear) {
|
||||
}
|
||||
}
|
||||
|
||||
void Raster::beginFadeInAnimation() {
|
||||
void Raster::beginFadeInTransition() {
|
||||
time start = util::now();
|
||||
fade_animation = std::make_shared<util::ease_animation>(opacity, 1.0, opacity, start, 250_milliseconds);
|
||||
fade_transition = std::make_shared<util::ease_transition>(opacity, 1.0, opacity, start, 250_milliseconds);
|
||||
}
|
||||
|
||||
bool Raster::needsAnimation() const {
|
||||
return fade_animation != nullptr;
|
||||
bool Raster::needsTransition() const {
|
||||
return fade_transition != nullptr;
|
||||
}
|
||||
|
||||
void Raster::updateAnimations(time now) {
|
||||
if (fade_animation->update(now) == util::animation::complete) {
|
||||
fade_animation = nullptr;
|
||||
void Raster::updateTransitions(time now) {
|
||||
if (fade_transition->update(now) == util::transition::complete) {
|
||||
fade_transition = nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#include <llmr/util/animation.hpp>
|
||||
#include <llmr/util/transition.hpp>
|
||||
#include <llmr/util/unitbezier.hpp>
|
||||
#include <llmr/platform/platform.hpp>
|
||||
|
||||
@@ -6,16 +6,16 @@ using namespace llmr::util;
|
||||
|
||||
UnitBezier ease(0.25, 0.1, 0.25, 1);
|
||||
|
||||
animation::~animation() {}
|
||||
transition::~transition() {}
|
||||
|
||||
ease_animation::ease_animation(double from, double to, double &value, time start, time duration)
|
||||
: animation(start, duration),
|
||||
ease_transition::ease_transition(double from, double to, double &value, time start, time duration)
|
||||
: transition(start, duration),
|
||||
from(from),
|
||||
to(to),
|
||||
value(value) {
|
||||
}
|
||||
|
||||
animation::state ease_animation::update(time now) const {
|
||||
transition::state ease_transition::update(time now) const {
|
||||
float t = progress(now);
|
||||
if (t >= 1) {
|
||||
value = to;
|
||||
Reference in New Issue
Block a user