Skip to content
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

Merged
merged 7 commits into from
Jun 10, 2018
Merged

Conversation

AGulev
Copy link
Contributor

@AGulev AGulev commented Jun 9, 2018

If layout changes when transaction in progress we have to finish current transaction

# 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.
}
end

local function finish_transaction(transition)
Copy link
Owner

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
Copy link
Owner

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?

Copy link
Contributor Author

@AGulev AGulev Jun 10, 2018

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.

Copy link
Owner

@britzl britzl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@britzl britzl merged commit c2239d6 into britzl:master Jun 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants