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

residual oscillation #24

Open
allen8300 opened this issue Jul 11, 2017 · 1 comment
Open

residual oscillation #24

allen8300 opened this issue Jul 11, 2017 · 1 comment

Comments

@allen8300
Copy link

Hi, man, thanks so much for your hard work.
But in the native Messages app, there is no oscillation, everything is smooth.
In the demo app, there is a residual oscillation.
Can you please solve it? So that it works more smoothly?

@iTofu
Copy link

iTofu commented Jul 9, 2018

Make sure item.center is returning X and Y values that are floats with NO DECIMALS.
https://stackoverflow.com/a/24564539/6137672

In that case:

// Line 87:
UIAttachmentBehavior *springBehaviour = [[UIAttachmentBehavior alloc] initWithItem:item attachedToAnchor:center];
// ->
center.x = (int)center.x;
center.y = (int)center.y;
UIAttachmentBehavior *springBehaviour = [[UIAttachmentBehavior alloc] initWithItem:item attachedToAnchor:center];

// Line 205:
UIAttachmentBehavior *springBehaviour = [[UIAttachmentBehavior alloc] initWithItem:attributes attachedToAnchor:attributes.center];
// ->
CGPoint center = attributes.center;
center.x = (int)center.x;
center.y = (int)center.y;
UIAttachmentBehavior *springBehaviour = [[UIAttachmentBehavior alloc] initWithItem:attributes attachedToAnchor:center];

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

No branches or pull requests

2 participants