Commit 76fbe2f4 authored by Eli Zaretskii's avatar Eli Zaretskii

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.
parent 98404995
......@@ -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);
}
}
......
......@@ -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);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment