1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-14 23:40:39 -08:00

Avoid floating-point exceptions while drawing underwave

* src/w32term.c (x_get_scale_factor):
* src/xterm.c (x_get_scale_factor): Don't let the scale factors
become less than 1.  Reported by Yuri D'Elia <wavexx@thregr.org> in
http://lists.gnu.org/archive/html/emacs-devel/2017-08/msg00459.html.
This commit is contained in:
Eli Zaretskii 2017-08-21 17:46:42 +03:00
parent 9840499564
commit 76fbe2f454
2 changed files with 8 additions and 4 deletions

View file

@ -318,8 +318,10 @@ x_get_scale_factor(struct w32_display_info *dpyinfo, int *scale_x, int *scale_y)
if (dpyinfo)
{
*scale_x = floor (dpyinfo->resx / base_res);
*scale_y = floor (dpyinfo->resy / base_res);
if (dpyinfo->resx > base_res)
*scale_x = floor (dpyinfo->resx / base_res);
if (dpyinfo->resy > base_res)
*scale_y = floor (dpyinfo->resy / base_res);
}
}

View file

@ -3483,8 +3483,10 @@ x_get_scale_factor(Display *disp, int *scale_x, int *scale_y)
if (dpyinfo)
{
*scale_x = floor (dpyinfo->resx / base_res);
*scale_y = floor (dpyinfo->resy / base_res);
if (dpyinfo->resx > base_res)
*scale_x = floor (dpyinfo->resx / base_res);
if (dpyinfo->resy > base_res)
*scale_y = floor (dpyinfo->resy / base_res);
}
}