Fix for resizing of circle

This commit is contained in:
Knut Sveidqvist
2024-09-26 13:13:37 +02:00
parent bcfc5e0ce4
commit a94ad012c4

View File

@@ -11,7 +11,7 @@ export const circle = async (parent: SVGAElement, node: Node): Promise<SVGAEleme
const { shapeSvg, bbox, halfPadding } = await labelHelper(parent, node, getNodeClasses(node)); const { shapeSvg, bbox, halfPadding } = await labelHelper(parent, node, getNodeClasses(node));
const labelPadding = node.look === 'neo' ? halfPadding * 2 : halfPadding; const labelPadding = node.look === 'neo' ? halfPadding * 2 : halfPadding;
const radius = bbox.width / 2 + labelPadding; const radius = Math.max(bbox.width / 2 + labelPadding, (node?.width ?? 0) / 2);
let circleElem; let circleElem;
const { cssStyles } = node; const { cssStyles } = node;
@@ -34,7 +34,6 @@ export const circle = async (parent: SVGAElement, node: Node): Promise<SVGAEleme
} }
updateNodeBounds(node, circleElem); updateNodeBounds(node, circleElem);
node.intersect = function (point) { node.intersect = function (point) {
log.info('Circle intersect', node, radius, point); log.info('Circle intersect', node, radius, point);
return intersect.circle(node, radius, point); return intersect.circle(node, radius, point);