Revert "fix: icon image positioning"

This reverts commit 67e8dbfe3a.
pull/1179/head
georgepstaylor 11 months ago
parent c6d40178de
commit 73446bd250
No known key found for this signature in database

@ -315,13 +315,14 @@ class Node:
self.label = prefix self.label = prefix
# fmt: off # fmt: off
# If a node has an icon, set the imagepos attr so # If a node has an icon, increase the height slightly to avoid
# that that the icon image is top centered. # that label being spanned between icon image and white space.
# Increase the height by the number of new lines included in the label.
padding = 0.4 * (self.label.count('\n'))
self._attrs = { self._attrs = {
"shape": "none", "shape": "none",
"height": str(self._height), "height": str(self._height + padding),
"image": self._load_icon(), "image": self._load_icon(),
"imagepos": "tc",
} if self._icon else {} } if self._icon else {}
# fmt: on # fmt: on

Loading…
Cancel
Save