-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
finish transaction when layout changes #21
Conversation
# Please enter a commit message to explain why this merge is necessary, # especially if it merges an updated upstream into a topic branch. # # Lines starting with '#' will be ignored, and an empty message aborts # the commit.
monarch/transitions/gui.lua
Outdated
} | ||
end | ||
|
||
local function finish_transaction(transition) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be finish_transition() not finish_transaction()?
@@ -139,6 +145,9 @@ function M.create(node) | |||
-- were transitioned out | |||
if current_transition then | |||
current_transition.fn(node, initial_data, current_transition.easing, 0, 0) | |||
if current_transition.in_progress then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So we call the transition function again on the line above to immediately finish it (duration = 0), but what if there already is a transition going? Won't the transition that was playing while the layout changed continue to play? Or does a call to gui.animate() override an existing animation? I think the default transitions need to do a gui.cancel_animation() as well or?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Default transition will be override by a new transition (with 0 duration) but without Done event because of nil callback of the new transition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good.
If layout changes when transaction in progress we have to finish current transaction