diff options
| author | Eli Zaretskii | 2017-08-21 17:46:42 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2017-08-21 17:46:42 +0300 |
| commit | 76fbe2f4541b11af8bcb0b5e57bb155b796b8d8e (patch) | |
| tree | 9d1387417298711062a0b1b4e81e625a9300bd2f /src/xterm.c | |
| parent | 9840499564c90c43b1d269154593ebe57a7cb9b0 (diff) | |
| download | emacs-76fbe2f4541b11af8bcb0b5e57bb155b796b8d8e.tar.gz emacs-76fbe2f4541b11af8bcb0b5e57bb155b796b8d8e.zip | |
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.
Diffstat (limited to 'src/xterm.c')
| -rw-r--r-- | src/xterm.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/xterm.c b/src/xterm.c index 2efa70b1dca..77daa22ae0d 100644 --- a/src/xterm.c +++ b/src/xterm.c | |||
| @@ -3483,8 +3483,10 @@ x_get_scale_factor(Display *disp, int *scale_x, int *scale_y) | |||
| 3483 | 3483 | ||
| 3484 | if (dpyinfo) | 3484 | if (dpyinfo) |
| 3485 | { | 3485 | { |
| 3486 | *scale_x = floor (dpyinfo->resx / base_res); | 3486 | if (dpyinfo->resx > base_res) |
| 3487 | *scale_y = floor (dpyinfo->resy / base_res); | 3487 | *scale_x = floor (dpyinfo->resx / base_res); |
| 3488 | if (dpyinfo->resy > base_res) | ||
| 3489 | *scale_y = floor (dpyinfo->resy / base_res); | ||
| 3488 | } | 3490 | } |
| 3489 | } | 3491 | } |
| 3490 | 3492 | ||