In set_mouse_pos(), try to avoid division by zero errors.

This commit is contained in:
Craig Rodrigues 2005-09-07 15:19:03 +00:00
parent 9020d67cf5
commit 3a9c56bec9
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=149855

View File

@ -157,7 +157,8 @@ set_mouse_pos(scr_stat *scp)
scp->mouse_ypos = (scp->ysize + scp->yoff)*scp->font_size - 1;
}
if (scp->mouse_xpos != scp->mouse_oldxpos || scp->mouse_ypos != scp->mouse_oldypos) {
if ((scp->mouse_xpos != scp->mouse_oldxpos || scp->mouse_ypos != scp->mouse_oldypos)
&& (scp->font_size != 0 && scp->font_width != 0)) {
scp->status |= MOUSE_MOVED;
scp->mouse_pos =
(scp->mouse_ypos/scp->font_size - scp->yoff)*scp->xsize