Skip to content

Commit

Permalink
Removed print statements
Browse files Browse the repository at this point in the history
  • Loading branch information
e100 committed Jun 16, 2024
1 parent 18fb119 commit 0a731bb
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/pyefis/instruments/helpers/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def fit_to_mask(iwidth,iheight,mask,font,units_mask=None, units_ratio=0.8):
# IF needed, shrink until it fits
while ( (text_width + units_width > width) or text_height > height ) and font_size > 0.5:
font_size -= 0.2
print(f"too wide trying: {font_size} text_width:{text_width}, units_width:{units_width}, width:{width}")
text_font.setPointSizeF(font_size)
fm = QFontMetrics(text_font)
text_width = fm.tightBoundingRect(mask).width()
Expand All @@ -39,7 +38,6 @@ def fit_to_mask(iwidth,iheight,mask,font,units_mask=None, units_ratio=0.8):
# If needed, grow until it fills
while (text_width + units_width < width) and text_height < height:
font_size += 0.2
print(f"Not wide enough, trying {font_size} text_width:{text_width}, units_width:{units_width}, width:{width}")
text_font.setPointSizeF(font_size)
fm = QFontMetrics(text_font)
text_width = fm.tightBoundingRect(mask).width()
Expand All @@ -55,7 +53,6 @@ def fit_to_mask(iwidth,iheight,mask,font,units_mask=None, units_ratio=0.8):
# The above took care of the width, this addresses the height:
while (text_height >= height) and font_size > 0.5:
font_size -= 0.2
print(f"too high, trying {font_size} text_height:{text_height}, height:{height}")
text_font.setPointSizeF(font_size)
fm = QFontMetrics(text_font)
text_width = fm.tightBoundingRect(mask).width()
Expand Down

0 comments on commit 0a731bb

Please sign in to comment.