diff --git a/packages/module/src/components/nodes/labels/LabelActionIcon.tsx b/packages/module/src/components/nodes/labels/LabelActionIcon.tsx index 08b3329..a799d19 100644 --- a/packages/module/src/components/nodes/labels/LabelActionIcon.tsx +++ b/packages/module/src/components/nodes/labels/LabelActionIcon.tsx @@ -20,12 +20,11 @@ interface LabelActionIconProps { } const LabelActionIcon = React.forwardRef( - ({ icon, isIconExternal, onClick, className, x, y, paddingX, height}) => { + ({ icon, isIconExternal, onClick, className, x, y, paddingX, height, iconOffsetX = 0, iconOffsetY = 0 }) => { const [iconSize, iconRef] = useSize([icon, paddingX]); const iconWidth = iconSize?.width ?? 0; - const iconHeight = iconSize?.height ?? 0; - // const [hovered, hoverRef] = useHover(); - + const iconHeight = iconSize?.height ?? 0; + const iconY = (height - iconHeight) / 2; const centerX = x + height / 2 - iconWidth / 2; const centerY = y + height / 2 - iconHeight / 2; @@ -46,13 +45,13 @@ const LabelActionIcon = React.forwardRef( className={isIconExternal ? css(pipelineStyles.topologyPipelinesNodeActionIconBackground) : css(styles.topologyNodeActionIconBackground)} x={x} y={y} - width={height} + width={isIconExternal ? height :iconWidth + paddingX * 2} height={height} /> )} {icon}