Skip to content

Commit

Permalink
merge: Fix default size for boxes
Browse files Browse the repository at this point in the history
  • Loading branch information
Wuestengecko committed Nov 9, 2023
2 parents 954aef1 + 86b290d commit cfe37c8
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 28 deletions.
1 change: 1 addition & 0 deletions capellambse/aird/_visual.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ def shape_factory(ebd: c.ElementBuilder) -> diagram.Box:
styleclass=styleclass,
# <https://github.com/python/mypy/issues/8136#issuecomment-565387901>
styleoverrides=styleoverrides, # type: ignore[arg-type]
minsize=diagram.Vector2D(100, 54),
)


Expand Down
6 changes: 4 additions & 2 deletions capellambse/diagram/_diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,8 +433,10 @@ def size(self) -> diagram.Vector2D:
):
height += 24

width = max(self.minsize.x, width)
height = max(self.minsize.y, height)
if needwidth:
width = max(self.minsize.x, width)
if needheight:
height = max(self.minsize.y, height)
return diagram.Vector2D(width, height)

@size.setter
Expand Down
76 changes: 50 additions & 26 deletions docs/source/examples/02 Intro to Physical Architecture API.ipynb

Large diffs are not rendered by default.

0 comments on commit cfe37c8

Please sign in to comment.