Adjusted min values

This commit is contained in:
Knut Sveidqvist
2024-09-30 14:53:33 +02:00
parent e8472c3647
commit f10d148097
3 changed files with 12 additions and 12 deletions

View File

@@ -14,13 +14,13 @@ export const drawRect = async (parent: SVGAElement, node: Node, options: RectOpt
// if so set it to min value
if (node.width || node.height) {
node.width = (node?.width ?? 0) - options.labelPaddingX * 2;
if (node.width < 50) {
node.width = 50;
if (node.width < 20) {
node.width = 20;
}
node.height = (node?.height ?? 0) - options.labelPaddingY * 2;
if (node.height < 50) {
node.height = 50;
if (node.height < 10) {
node.height = 10;
}
}

View File

@@ -22,13 +22,13 @@ export const question = async (parent: SVGAElement, node: Node): Promise<SVGAEle
const padding = node.padding ?? 0;
if (node.width || node.height) {
node.width = (node?.width ?? 0) - padding * 8;
if (node.width < 50) {
node.width = 50;
if (node.width < 20) {
node.width = 20;
}
node.height = (node?.height ?? 0) - padding * 8;
if (node.height < 50) {
node.height = 50;
if (node.height < 10) {
node.height = 10;
}
}

View File

@@ -62,13 +62,13 @@ export const stadium = async (parent: SVGAElement, node: Node) => {
// if so set it to min value
if (node.width || node.height) {
node.width = (node?.width ?? 0) - labelPaddingX * 2;
if (node.width < 50) {
node.width = 50;
if (node.width < 20) {
node.width = 20;
}
node.height = (node?.height ?? 0) - labelPaddingY * 2;
if (node.height < 50) {
node.height = 50;
if (node.height < 10) {
node.height = 10;
}
}
const { shapeSvg, bbox } = await labelHelper(parent, node, getNodeClasses(node));