Skip to content

Commit adddcf2

Browse files
Add height & width properties to LabelBase
1 parent fbe1fbd commit adddcf2

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

adafruit_display_text/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,16 @@ def bounding_box(self) -> Tuple[int, int]:
385385
first two numbers are offset from the x, y origin of this group"""
386386
return tuple(self._bounding_box)
387387

388+
@property
389+
def height(self) -> int:
390+
"""The height of the label determined from the bounding box."""
391+
return self._bounding_box[3] - self._bounding_box[1]
392+
393+
@property
394+
def width(self) -> int:
395+
"""The width of the label determined from the bounding box."""
396+
return self._bounding_box[2] - self._bounding_box[0]
397+
388398
@property
389399
def line_spacing(self) -> float:
390400
"""The amount of space between lines of text, in multiples of the font's

0 commit comments

Comments
 (0)