fixup! UI: Ensure tweens always complete.

This commit is contained in:
Unknown W. Brackets 2017-12-03 11:49:34 -08:00
parent 9f000ddf35
commit c29ae5ff56

View file

@ -54,7 +54,7 @@ public:
const Value newFrom = Current(Position());
// Are we already part way through another transition?
if (!Finished()) {
if (time_now() < start_ + duration_) {
if (newTo == to_) {
// Already on course. Don't change.
} else if (newTo == from_) {
@ -92,6 +92,16 @@ public:
to_ = newFrom;
}
const Value &FromValue() const {
return from_;
}
const Value &ToValue() const {
return to_;
}
Value CurrentValue() {
return Current(Position());
}
protected:
virtual Value Current(float pos) = 0;