mirror of
https://codeberg.org/dnkl/foot.git
synced 2026-04-08 08:20:59 -04:00
wayland: don’t crash with a division-by-zero when monitor dimensions are negative
Some compositors set the physical dimensions to -1...
This commit is contained in:
parent
b7ba842237
commit
50ae277d90
1 changed files with 1 additions and 1 deletions
|
|
@ -367,7 +367,7 @@ update_terms_on_monitor(struct monitor *mon)
|
||||||
static void
|
static void
|
||||||
output_update_ppi(struct monitor *mon)
|
output_update_ppi(struct monitor *mon)
|
||||||
{
|
{
|
||||||
if (mon->dim.mm.width == 0 || mon->dim.mm.height == 0)
|
if (mon->dim.mm.width <= 0 || mon->dim.mm.height <= 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
int x_inches = mon->dim.mm.width * 0.03937008;
|
int x_inches = mon->dim.mm.width * 0.03937008;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue