Handle fixed size for hexagon

This commit is contained in:
Knut Sveidqvist
2024-09-26 13:20:44 +02:00
parent a94ad012c4
commit 0ba4265bc3

View File

@@ -33,9 +33,9 @@ export const hexagon = async (parent: SVGAElement, node: Node): Promise<SVGAElem
const nodePadding = node.padding ?? 0;
const labelPaddingX = node.look === 'neo' ? nodePadding * 3 : nodePadding;
const labelPaddingY = node.look === 'neo' ? nodePadding * 1.5 : nodePadding;
const h = bbox.height + labelPaddingX;
const h = Math.max(bbox.height + labelPaddingX, node?.height ?? 0);
const m = h / f;
const w = bbox.width + 2 * m + labelPaddingY;
const w = Math.max(bbox.width + 2 * m + labelPaddingY, node?.width ?? 0);
const points = [
{ x: m, y: 0 },
{ x: w - m, y: 0 },