Edge not aligned with handle when scale is applied
See original GitHub issueHi there. I’ve got an issue similar to #1075 and #1136 where the calculated edge path does not align with handles, and my use case may provide some insight onto why it’s happening.
I use spectacle to create presentations and recently wanted to start using graphs created with react-flow in the slide. However, there is something strange happening when the slide is scaled down. The image below is from the graph rendered on a slide.
This one is the graph rendered outside of the Spectrum <Slide>
component, but otherwise identical. The edges are correct.
I can confirm that it has something to do with the scale transform based on the slide’s height and width. If I change the size of the slide and reduce its dimensions (e.g., 1280x720 instead of 1920x1080) the misalignment is less severe but still present.
If you use the Spectacle print mode, the edges are more accurate, but still slightly off.
This may be too complex of a use case for a fix, especially if it is the result of a misconfiguration of Spectacle. But I figured that it at least gives you a reproducible example of the misalignment issue.
Any ideas on how prevent this from happening when you’re working with a graph contained in a non-standard series of DOM elements?
Thanks in advance. Love the library!
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:10 (4 by maintainers)
Top GitHub Comments
Codesandbox here
If you just render the
<TestFlow />
element, the edges are aligned. If you render it within the Spectacle Components, the edges are misaligned.As an FYI, my workaround was just to recalculate the elements myself in a custom edge.
In order to get the correct edgePath, you could do something like the following: