question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TemporalActions don't always end on ending value

See original GitHub issue

Due to floating point arithmetic, TemporalActions that have an end argument aren’t guaranteed to end on that state.

Arbitrary example (Kotlin):

val action = ColorAction()
action.color = Color(0xffffffff.toInt())
action.duration = 1f
action.interpolation = Interpolation.pow5Out
action.endColor = Color(0x444444ff)

After execution, I would expect the actor’s color to be 0x444444ff; however, it’s 0x434343ff.

Would it make sense override end and do the equivalent of color.set(endColor) for all affected actions?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:11 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
obigucommented, Jan 18, 2019

Would it make sense override end and do the equivalent of color.set(endColor) for all affected actions?

Need to be careful as the action may be reversed in which case the final color on action complete is the start color. I think it’s safer to deal with this inside the update for the special case where percentage == 1f.

0reactions
obigucommented, Mar 9, 2019

@NathanSweet My comment was more oriented to the fact that start and end Color should be either both Colors instances or both be stored as their float components more than about the necessity of exposing the getter for the start color (haven’t suggested having a setter). After some more thought, I think the argument for minimal memory allocation outweights the benefits of using Color instances and, imo, end Color should also be stored as its float components (maybe lazily created if getEndColor() is called)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Workflows | Temporal Documentation
There are three possible values: Abandon: the Child Workflow Execution is not affected. Request Cancel: a Cancellation request is sent to the Child...
Read more >
Actions and Events in Interval Temporal Logic
We present a representation of events and action based on interval ... effects become true at the end of the event and remain...
Read more >
The Temporal Logic of Actions - Leslie Lamport
A temporal formula is built from elementary formulas using boolean operators and the unary operator ✷ (read always). For example, if E1 and...
Read more >
The Temporal Logic of Actions - Microsoft
A temporal formula is built from elementary formulas using boolean operators and the unary operator ✷ (read always). For example, if E1 and...
Read more >
Self-maintaining, Contiguous Effective Dates in Temporal Tables
This is because the 'effective end date' is implied by the effective date on the subsequent row, and the current price is always...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found