mirror of
https://github.com/enzet/map-machine.git
synced 2025-06-04 20:01:53 +02:00
Move point size computation.
This commit is contained in:
parent
b5b3da860d
commit
5ec794cd6b
2 changed files with 16 additions and 10 deletions
|
@ -220,3 +220,15 @@ class Point(Tagged):
|
|||
))
|
||||
|
||||
self.y += 11
|
||||
|
||||
def get_size(self) -> np.array:
|
||||
"""
|
||||
Get width and height of the point visual representation if there is
|
||||
space for all elements.
|
||||
"""
|
||||
icon_size: int = 16
|
||||
width: int = (1 + max(2, len(self.icon.extra_icons) - 1)) * icon_size
|
||||
height: int = (1 + int(len(self.icon.extra_icons) / 3)) * icon_size
|
||||
if len(self.labels):
|
||||
height += 2 + 11 * len(self.labels)
|
||||
return np.array((width, height))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue