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

The edge path doesn't work well with the CSS scale. #4266

Open
42arch opened this issue May 9, 2024 · 2 comments
Open

The edge path doesn't work well with the CSS scale. #4266

42arch opened this issue May 9, 2024 · 2 comments

Comments

@42arch
Copy link

42arch commented May 9, 2024

Describe the Bug

I'm trying to add the CSS style property transform: scale(0.7) to the reactflow component, but the edge path is shifted.
1
2

I don't know where the reason comes from. Maybe it's a react issue or an SVG issue?
Thanks!

Your Example Website or App

https://stackblitz.com/edit/vitejs-vite-q272d9?file=src%2FApp.jsx

Steps to Reproduce the Bug or Issue

Just like what's in the repro demo.

Expected behavior

You can click the button on the demo page, if scaling it after a while, it goes well, without shifting.

Screenshots or Videos

No response

Platform

  • OS: [Windows]
  • Browser: [Chrome]
  • Version: [124.0.6367.63]

Additional context

No response

@moklick
Copy link
Member

moklick commented May 9, 2024

Why do you want to scale the container? If you want to adjust the viewport, you should use setViewport.

@42arch
Copy link
Author

42arch commented May 10, 2024

Thanks for your reply!
I have a special situation where the position of the ReactFlow layout is pre-calculated, and it is aligned with other components (ReactFlow's sibling component). The setViewport can only adjust the flow's viewport, but I want both the flow component and the other components to be adjusted together. So I used transform: scale() to achieve it.

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