2
0

💄 Improve edges alignment when connected to blocks

Related to #219
This commit is contained in:
Baptiste Arnaud
2023-01-27 15:25:03 +01:00
parent 409e7643ad
commit 068f9bbd17
4 changed files with 5 additions and 5 deletions

View File

@ -55,7 +55,6 @@ export const SourceEndpoint = ({
if (!groupsCoordinates) return <></> if (!groupsCoordinates) return <></>
return ( return (
<Flex <Flex
ref={ref}
data-testid="endpoint" data-testid="endpoint"
boxSize="32px" boxSize="32px"
rounded="full" rounded="full"
@ -66,6 +65,7 @@ export const SourceEndpoint = ({
{...props} {...props}
> >
<Flex <Flex
ref={ref}
boxSize="20px" boxSize="20px"
justify="center" justify="center"
align="center" align="center"

View File

@ -25,7 +25,7 @@ export const TargetEndpoint = ({
return ( return (
<Box <Box
ref={ref} ref={ref}
boxSize="15px" boxSize="20px"
rounded="full" rounded="full"
bgColor="blue.500" bgColor="blue.500"
cursor="pointer" cursor="pointer"

View File

@ -215,8 +215,8 @@ export const BlockNode = ({
<BlockNodeContent block={block} indices={indices} /> <BlockNodeContent block={block} indices={indices} />
<TargetEndpoint <TargetEndpoint
pos="absolute" pos="absolute"
left="-32px" left="-34px"
top="19px" top="16px"
blockId={block.id} blockId={block.id}
/> />
{isConnectable && hasDefaultConnector(block) && ( {isConnectable && hasDefaultConnector(block) && (

View File

@ -343,7 +343,7 @@ export const getEndpointTopOffset = ({
if (!endpointId) return if (!endpointId) return
const endpointRef = endpoints[endpointId]?.ref const endpointRef = endpoints[endpointId]?.ref
if (!endpointRef?.current) return if (!endpointRef?.current) return
const endpointHeight = 34 * graphScale const endpointHeight = 20 * graphScale
return ( return (
(endpointRef.current.getBoundingClientRect().y + (endpointRef.current.getBoundingClientRect().y +
endpointHeight / 2 - endpointHeight / 2 -