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 <jonah.iden@typefox.io>
  • Loading branch information
jonah-iden authored and spoenemann committed Nov 6, 2023
1 parent 3625d2d commit 727c224
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 727c224

Please sign in to comment.