From 38209a3d3bdffe349beb919a83d286b67d97713c Mon Sep 17 00:00:00 2001 From: Faris Demirovic <63470556+farisd16@users.noreply.github.com> Date: Fri, 9 Aug 2024 09:30:57 +0200 Subject: [PATCH] Class Diagram: Adjust spacing of newly added lines to a class (#357) --- .../uml-classifier/uml-classifier-member.ts | 4 ++-- .../uml-class-diagram/class-preview.ts | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/packages/common/uml-classifier/uml-classifier-member.ts b/src/main/packages/common/uml-classifier/uml-classifier-member.ts index e06ee55d4..436bbdf4d 100644 --- a/src/main/packages/common/uml-classifier/uml-classifier-member.ts +++ b/src/main/packages/common/uml-classifier/uml-classifier-member.ts @@ -4,7 +4,7 @@ import { ILayoutable } from '../../../services/layouter/layoutable'; import { IUMLElement, UMLElement } from '../../../services/uml-element/uml-element'; import { UMLElementFeatures } from '../../../services/uml-element/uml-element-features'; import { assign } from '../../../utils/fx/assign'; -import { IBoundary } from '../../../utils/geometry/boundary'; +import { IBoundary, computeDimension } from '../../../utils/geometry/boundary'; import { Text } from '../../../utils/svg/text'; export abstract class UMLClassifierMember extends UMLElement { @@ -19,7 +19,7 @@ export abstract class UMLClassifierMember extends UMLElement { updatable: false, }; - bounds: IBoundary = { ...this.bounds, height: 30 }; + bounds: IBoundary = { ...this.bounds, height: computeDimension(1.0, 30) }; constructor(values?: DeepPartial) { super(values); diff --git a/src/main/packages/uml-class-diagram/class-preview.ts b/src/main/packages/uml-class-diagram/class-preview.ts index b3d7ad26b..052ee6d76 100644 --- a/src/main/packages/uml-class-diagram/class-preview.ts +++ b/src/main/packages/uml-class-diagram/class-preview.ts @@ -39,7 +39,7 @@ export const composeClassPreview: ComposePreview = (layer: ILayer, translate: (i x: 0, y: 0, width: computeDimension(1.0, 200), - height: computeDimension(1.0, 40), + height: computeDimension(1.0, 30), }, }); @@ -50,7 +50,7 @@ export const composeClassPreview: ComposePreview = (layer: ILayer, translate: (i x: 0, y: 0, width: computeDimension(1.0, 200), - height: computeDimension(1.0, 40), + height: computeDimension(1.0, 30), }, }); @@ -71,7 +71,7 @@ export const composeClassPreview: ComposePreview = (layer: ILayer, translate: (i x: 0, y: 40, width: computeDimension(1.0, 200), - height: computeDimension(1.0, 40), + height: computeDimension(1.0, 30), }, }); const umlAbstractMethod = new UMLClassMethod({ @@ -81,7 +81,7 @@ export const composeClassPreview: ComposePreview = (layer: ILayer, translate: (i x: 0, y: 70, width: computeDimension(1.0, 200), - height: computeDimension(1.0, 40), + height: computeDimension(1.0, 30), }, }); umlAbstract.ownedElements = [umlAbstractAttribute.id, umlAbstractMethod.id]; @@ -104,7 +104,7 @@ export const composeClassPreview: ComposePreview = (layer: ILayer, translate: (i x: 0, y: 50, width: computeDimension(1.0, 200), - height: computeDimension(1.0, 40), + height: computeDimension(1.0, 30), }, }); const umlInterfaceMethod = new UMLClassMethod({ @@ -114,7 +114,7 @@ export const composeClassPreview: ComposePreview = (layer: ILayer, translate: (i x: 0, y: 80, width: computeDimension(1.0, 200), - height: computeDimension(1.0, 40), + height: computeDimension(1.0, 30), }, }); umlInterface.ownedElements = [umlInterfaceAttribute.id, umlInterfaceMethod.id]; @@ -137,7 +137,7 @@ export const composeClassPreview: ComposePreview = (layer: ILayer, translate: (i x: 0, y: 50, width: computeDimension(1.0, 200), - height: computeDimension(1.0, 40), + height: computeDimension(1.0, 30), }, }); const umlEnumerationCase2 = new UMLClassAttribute({ @@ -147,7 +147,7 @@ export const composeClassPreview: ComposePreview = (layer: ILayer, translate: (i x: 0, y: 80, width: computeDimension(1.0, 200), - height: computeDimension(1.0, 40), + height: computeDimension(1.0, 30), }, }); const umlEnumerationCase3 = new UMLClassAttribute({ @@ -157,7 +157,7 @@ export const composeClassPreview: ComposePreview = (layer: ILayer, translate: (i x: 0, y: 110, width: computeDimension(1.0, 200), - height: computeDimension(1.0, 40), + height: computeDimension(1.0, 30), }, }); umlEnumeration.ownedElements = [umlEnumerationCase1.id, umlEnumerationCase2.id, umlEnumerationCase3.id];