mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-03-16 05:34:00 -04:00
term: add pt_or_px_as_pixels()
This function takes a ‘union pt_or_px’ and converts its value to a pixel value.
This commit is contained in:
parent
17339410ef
commit
5ea37adaf4
1 changed files with 9 additions and 0 deletions
|
|
@ -608,6 +608,15 @@ err_sem_destroy:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
pt_or_px_as_pixels(const struct terminal *term,
|
||||||
|
const union pt_or_px *pt_or_px)
|
||||||
|
{
|
||||||
|
return pt_or_px->px == 0
|
||||||
|
? pt_or_px->pt * term->font_dpi / 72
|
||||||
|
: pt_or_px->px;
|
||||||
|
}
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
term_set_fonts(struct terminal *term, struct fcft_font *fonts[static 4])
|
term_set_fonts(struct terminal *term, struct fcft_font *fonts[static 4])
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue