Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Class Diagram: Adjust spacing of newly added lines to a class #357

Merged
merged 2 commits into from
Aug 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading