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: Properly scale the image when the scale prop is changed #2134

Merged
merged 1 commit into from
Dec 7, 2024

Conversation

YordanIliev2002
Copy link
Contributor

@YordanIliev2002 YordanIliev2002 commented Oct 23, 2024

Why

Image gets skewed, when updating the scale field.
Consider this codepen.
At first, you can see that all borders are visible. When you click on the image, it gets bigger, but it becomes skewed (the borders are no longer visible). Even resetting the scale back to 1 (by clicking) doesn't fix the skew.

Before clicking

image

After clicking

image

What

Turns out, that the useLayoutEffect is missing dependencies in the dependency array.
After adding them, the issue is fixed, and the change of scale works properly.

Checklist

  • Ready to be merged

Copy link

vercel bot commented Oct 23, 2024

@YordanIliev2002 is attempting to deploy a commit to the Poimandres Team on Vercel.

A member of the Team first needs to authorize it.

Copy link

codesandbox-ci bot commented Oct 23, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link

vercel bot commented Oct 30, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
drei ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 6, 2024 4:26pm

@YordanIliev2002
Copy link
Contributor Author

The previous pipeline failed with an unrelated peer dependency error. Please reauthorize the workflow🙏

@YordanIliev2002
Copy link
Contributor Author

@abernier, sorry for tagging, but I see that you ran the workflow the previous time. Could you reauthorize the workflow and hopefully merge soon?

@abernier
Copy link
Member

abernier commented Dec 7, 2024

as in

/* eslint react-hooks/exhaustive-deps: 1 */
would probably safe to enable the eslint exhausted-deps rule

@drcmda drcmda merged commit 01be10e into pmndrs:master Dec 7, 2024
4 of 5 checks passed
@drcmda
Copy link
Member

drcmda commented Dec 7, 2024

added the comment

Copy link

github-actions bot commented Dec 7, 2024

🎉 This PR is included in version 9.120.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants