Skip to content

Remove debugging prints from TextBox #218

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions adafruit_display_text/text_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,6 @@ def __init__(

super(bitmap_label.Label, self).__init__(font, **kwargs)

print(f"before reset: {self._text}")

self._text = "\n".join(self.lines)
self._text = self._replace_tabs(self._text)
self._original_text = self._text
Expand All @@ -107,7 +105,6 @@ def __init__(
line_spacing=self._line_spacing,
scale=self.scale,
)
print(f"after reset: {self._text}")

def _place_text(
self,
Expand Down Expand Up @@ -141,21 +138,18 @@ def _place_text(
xposition = x_start # pylint: disable=used-before-assignment

y_start = yposition
# print(f"start loc {x_start}, {y_start}")

left = None
right = x_start
top = bottom = y_start
line_spacing = self._line_spacing

# print(f"cur_line width: {cur_line_width}")
for char in text:
if char == "\n": # newline
cur_line_index += 1
cur_line_width = self._text_bounding_box(
self.lines[cur_line_index], self.font
)[0]
# print(f"cur_line width: {cur_line_width}")
if self.align == self.ALIGN_LEFT:
x_start = original_xposition # starting x position (left margin)
if self.align == self.ALIGN_CENTER:
Expand Down Expand Up @@ -259,7 +253,6 @@ def _reset_text(
text = self._text

self._text = self._replace_tabs(text)
print(f"inside reset_text text: {text}")

# Check for empty string
if (text == "") or (
Expand Down Expand Up @@ -317,7 +310,6 @@ def _reset_text(
box_y = box_y + self._padding_top + self._padding_bottom

if self.dynamic_height:
print(f"dynamic height, box_y: {box_y}")
self._height = box_y

# Create the Bitmap unless it can be reused
Expand Down Expand Up @@ -375,7 +367,6 @@ def _reset_text(
tight_box_x,
tight_box_y,
)
print(f"end of reset_text bounding box: {self._bounding_box}")

if (
scale is not None
Expand Down