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

fix(Levioso): changing speed causes jerkiness #212

Merged
merged 4 commits into from
Oct 10, 2023

Conversation

andretchen0
Copy link
Contributor

Closes #208

Before (speed scales elapsed):

scale_elapsed.mov

After (speed scales delta):

scale_delta.mov

Refactors

I took the initiative to do a few refactors, each in separate commits:

  • Removing an unexposed, unchanging ref: offset
  • Extracting and naming constants, and "hiding" them in a closure
  • Removing some nullish checks on props.range

Please especially have a look at the last one:

props.range is assigned a default value. It seems to me that it can't be null or undefined. It's typed as [number, number], so the type checker should signal an error, e.g., if :range="[1]".

The other props fields don't have null checks.

So I removed the null checks on props.range, but maybe I'm missing something.

Thanks!

@andretchen0 andretchen0 linked an issue Sep 13, 2023 that may be closed by this pull request
5 tasks
@netlify
Copy link

netlify bot commented Sep 13, 2023

Deploy Preview for cientos-tresjs ready!

Name Link
🔨 Latest commit 6885ffb
🔍 Latest deploy log https://app.netlify.com/sites/cientos-tresjs/deploys/65022de0861f5d0008b5f4e6
😎 Deploy Preview https://deploy-preview-212--cientos-tresjs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@andretchen0 andretchen0 marked this pull request as ready for review September 13, 2023 21:51
@andretchen0
Copy link
Contributor Author

Hey, @alvarosabu

Any chance this will get merged?

My concrete use case:

I used Levioso in a demo for Lensflare with Leches controls.

In order to show off the Lensflare, it has to move behind other elements, but that's not good for seeing the effects of modifying props.

So, when the Leches controls modify props, I slow the Levioso to a stop for a moment. That way the user can see the effects of the new props settings.

But changing the Levioso speed produces the jerky movement at the top of the PR.

@alvarosabu
Copy link
Member

@andretchen0 sorry it took too long for me to take a look, I'm gonna check it

@alvarosabu alvarosabu merged commit a941576 into main Oct 10, 2023
7 checks passed
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.

Levioso – changing speed leads to (likely) unwanted behavior
2 participants