Changed the way the transform is applied to the edges group

This commit is contained in:
Philipp Garbowsky
2021-10-28 15:44:21 +02:00
parent 5cecc27ee9
commit a29d9de6b0
+2 -2
View File
@@ -208,13 +208,13 @@ const EdgeRenderer = (props: EdgeRendererProps) => {
connectionLineComponent, connectionLineComponent,
onlyRenderVisibleElements, onlyRenderVisibleElements,
} = props; } = props;
const transformStyle = `translate(${transform[0]},${transform[1]}) scale(${transform[2]})`; const transformStyle = `translate(${transform[0]}px,${transform[1]}px) scale(${transform[2]})`;
const renderConnectionLine = connectionNodeId && connectionHandleType; const renderConnectionLine = connectionNodeId && connectionHandleType;
return ( return (
<svg width={width} height={height} className="react-flow__edges"> <svg width={width} height={height} className="react-flow__edges">
<MarkerDefinitions color={arrowHeadColor} /> <MarkerDefinitions color={arrowHeadColor} />
<g transform={transformStyle}> <g style={{ transform: transformStyle }}>
{edges.map((edge: Edge) => ( {edges.map((edge: Edge) => (
<Edge <Edge
key={edge.id} key={edge.id}