Skip to content

Commit

Permalink
Class Diagram: Adjust spacing of newly added lines to a class (#357)
Browse files Browse the repository at this point in the history
  • Loading branch information
farisd16 authored Aug 9, 2024
1 parent b7efbbd commit 38209a3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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<IUMLElement>) {
super(values);
Expand Down
18 changes: 9 additions & 9 deletions src/main/packages/uml-class-diagram/class-preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
},
});

Expand All @@ -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),
},
});

Expand All @@ -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({
Expand All @@ -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];
Expand All @@ -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({
Expand All @@ -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];
Expand All @@ -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({
Expand All @@ -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({
Expand All @@ -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];
Expand Down

0 comments on commit 38209a3

Please sign in to comment.