Skip to content

Commit

Permalink
fix: round floats to ints
Browse files Browse the repository at this point in the history
  • Loading branch information
loiccoyle committed Sep 21, 2024
1 parent 9d009f9 commit 4f87a1a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tinyticker/layouts/big_logo.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,10 @@ def big_logo(
),
),
)
plot_size = (plot_width, logo_height - range_text_font.getbbox(range_text)[3])
plot_size = (
plot_width,
logo_height - int(round(range_text_font.getbbox(range_text)[3])),
)

fig, axes = historical_plot(plot_size, ticker, resp)
apply_layout_config(axes[0], ticker.config.layout, resp)
Expand All @@ -80,7 +83,7 @@ def big_logo(
font=range_text_font,
fill=0,
)
available_space = size[1] - (plot_size[1] + (range_text_bbox[3]))
available_space = int(round(size[1] - (plot_size[1] + (range_text_bbox[3]))))

price_text = f"{CURRENCY_SYMBOLS.get(ticker.currency, '$')}{resp.current_price:.2f}"
price_text_bbox = regular_font.getbbox(price_text)
Expand Down

0 comments on commit 4f87a1a

Please sign in to comment.