Skip to content

Commit

Permalink
Fixing text canvas dimensions on some platforms, e.g. GK7205v200 (as …
Browse files Browse the repository at this point in the history
…suggested by @oaidar)
  • Loading branch information
William Bérubé committed Apr 22, 2024
1 parent 87680ca commit 8ae78da
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion osd/text.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,9 @@ RECT measure_text(const char *font, double size, const char *text)

double margin, height, width;
calcdim(&margin, &height, &width, text);
RECT rect = { .height = height, .width = width };
// Some platforms operate with a coarse pixel size of 2x2
// and rounding up is required for a sufficient canvas size
RECT rect = { .height = ceil(height + (height & 1)), .width = ceil(width + (width & 1)) };

sft_freefont(sft.font);
return rect;
Expand Down

0 comments on commit 8ae78da

Please sign in to comment.