Skip to content

Commit

Permalink
fixed (w/h)Align center for containers with min width
Browse files Browse the repository at this point in the history
Signed-off-by: Jonah Iden <[email protected]>
  • Loading branch information
jonah-iden committed Nov 3, 2023
1 parent 3625d2d commit 1da16f1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/sprotty/src/features/bounds/abstract-layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ export abstract class AbstractLayout<T extends AbstractLayoutOptions> implements
const childrenSize = this.getChildrenSize(container, options, layouter);
const maxWidth = options.paddingFactor * (
options.resizeContainer
? childrenSize.width
? Math.max(childrenSize.width, options.minWidth)
: Math.max(0, this.getFixedContainerBounds(container, options, layouter).width) - options.paddingLeft - options.paddingRight);
const maxHeight = options.paddingFactor * (
options.resizeContainer
? childrenSize.height
? Math.max(childrenSize.height, options.minHeight)
: Math.max(0, this.getFixedContainerBounds(container, options, layouter).height) - options.paddingTop - options.paddingBottom);
if (maxWidth > 0 && maxHeight > 0) {
const offset = this.layoutChildren(container, layouter, options, maxWidth, maxHeight);
Expand Down

0 comments on commit 1da16f1

Please sign in to comment.