Added wait() method to delay movement at the specified point#30
Open
klapstoelpiloot wants to merge 1 commit intomobius3:masterfrom
Open
Added wait() method to delay movement at the specified point#30klapstoelpiloot wants to merge 1 commit intomobius3:masterfrom
klapstoelpiloot wants to merge 1 commit intomobius3:masterfrom
Conversation
mobius3
requested changes
Jan 1, 2022
Owner
There was a problem hiding this comment.
Thanks! I see the point of having a wait() feature. There are a couple things that needs to be addressed in your PR:
- your indentation looks off in regard to the rest of the project (it may be that the indentation of the project looks off in regard to the rest of the world but it is what it is :)
- I se that you've made the
calculateTotal()function. Since it's not returning a calculation but rather updating totals, I believeupdateStackedTotals()would be a better name orsomething else that implies change - I'd implement
wait()usingtween::during()instead of duplicating it's code. I'd also say to callto()before, with the last value, but unboxing it may be somewhat hard to do so (see tween::dispatch(), not pretty). But for the duration, callingtween::during()is the way to go. And maybe we don't actually need the calculateTotal/updateStackedtotals function anymore. - I believe you should set the
steppedeasing for this. By default tweeny it uses linear easing which makes unecessary calculations in this case.steppedreturns always the first value which is what you want here. - You should explain in the docs of this function that it is effectively equal to calling (
from(a).to(a).during(...).via(stepped)) because although we're providing a useful functionality, we're also breaking user expectations in regards to the amount of easing points. It is known thatto()adds a point but thatwait()adds another is not and it's not obvious and this breaksseek()andjump()expectations. This has to be made explicit.
Thanks again for your PR!
Author
|
Fair points. I'll see what I can do to implement your requested changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This implements my request #29