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

Editor goes crazy when using a lambda curve #14

Closed
fryguy1013 opened this issue Feb 19, 2017 · 2 comments
Closed

Editor goes crazy when using a lambda curve #14

fryguy1013 opened this issue Feb 19, 2017 · 2 comments

Comments

@fryguy1013
Copy link

image

    this.square1 = new mojs.Shape({
        parent: this.parentShape.el,
        duration: 3000,
        radius: 100,
        y: { 150: 150, curve: this.yCurve.getEasing() },
        scaleX: { 1: 1, curve: p => 1 - this.scaleCurve.getEasing()(p) },
        scaleY: { 1: 1, curve: p => 1 + this.scaleCurve.getEasing()(p) },
        angle: { [5]: 5, curve: this.angleCurve.getEasing() }
    });

With just scaleX: { 1: 1, curve: this.scaleCurve.getEasing() }, this seems to work fine, but the example above caused the screenshot above.

@fryguy1013
Copy link
Author

This was fixed for me by not getting the easing every time calling in, and instead caching the value before this function. But it still feels like the above behavior is not the greatest :)

@legomushroom
Copy link
Member

Hey @fryguy1013, thanks for the issue.

That's interesting, looks like rendering artifacts were introduced, probably because of a performance bottleneck. You definitely want to cache the this.scaleCurve.getEasing() because otherwise, you are sampling the SVG path on every animation frame which is pretty slow operation.

Cheers~

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