From bf63eb69676e4bb7804802c3d3a727dbfac149d0 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Jan=20Dj=C3=A4rv?= Date: Wed, 14 Dec 2005 20:58:33 +0000 Subject: [PATCH] * xfns.c (compute_tip_xy): Handle negative dx and dy. * w32fns.c (compute_tip_xy): Ditto * macfns.c (compute_tip_xy): Ditto --- src/ChangeLog | 8 ++++++++ src/macfns.c | 6 +++++- src/w32fns.c | 4 ++++ src/xfns.c | 4 ++++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index b26416b783..369846e302 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2005-12-14 Jan Dj,Ad(Brv + + * xfns.c (compute_tip_xy): Handle negative dx and dy. + + * w32fns.c (compute_tip_xy): Ditto + + * macfns.c (compute_tip_xy): Ditto + 2005-12-14 Chong Yidong * print.c (print_preprocess): Go to a deeper print_depth to avoid diff --git a/src/macfns.c b/src/macfns.c index de6a055fce..99abc64304 100644 --- a/src/macfns.c +++ b/src/macfns.c @@ -3840,9 +3840,11 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) if (INTEGERP (top)) *root_y = XINT (top); + else if (*root_y + XINT (dy) <= 0) + *root_y = 0; /* Can happen for negative dy */ else if (*root_y + XINT (dy) + height <= FRAME_MAC_DISPLAY_INFO (f)->height) /* It fits below the pointer */ - *root_y += XINT (dy); + *root_y += XINT (dy); else if (height + XINT (dy) <= *root_y) /* It fits above the pointer. */ *root_y -= height + XINT (dy); @@ -3852,6 +3854,8 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) if (INTEGERP (left)) *root_x = XINT (left); + else if (*root_x + XINT (dx) <= 0) + *root_x = 0; /* Can happen for negative dx */ else if (*root_x + XINT (dx) + width <= FRAME_MAC_DISPLAY_INFO (f)->width) /* It fits to the right of the pointer. */ *root_x += XINT (dx); diff --git a/src/w32fns.c b/src/w32fns.c index 647267972d..b82814bca7 100644 --- a/src/w32fns.c +++ b/src/w32fns.c @@ -7411,6 +7411,8 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) if (INTEGERP (top)) *root_y = XINT (top); + else if (*root_y + XINT (dy) <= 0) + *root_y = 0; /* Can happen for negative dy */ else if (*root_y + XINT (dy) + height <= FRAME_W32_DISPLAY_INFO (f)->height) /* It fits below the pointer */ *root_y += XINT (dy); @@ -7423,6 +7425,8 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) if (INTEGERP (left)) *root_x = XINT (left); + else if (*root_x + XINT (dx) <= 0) + *root_x = 0; /* Can happen for negative dx */ else if (*root_x + XINT (dx) + width <= FRAME_W32_DISPLAY_INFO (f)->width) /* It fits to the right of the pointer. */ *root_x += XINT (dx); diff --git a/src/xfns.c b/src/xfns.c index 667b1411d1..ead4d76c71 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -4940,6 +4940,8 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) if (INTEGERP (top)) *root_y = XINT (top); + else if (*root_y + XINT (dy) <= 0) + *root_y = 0; /* Can happen for negative dy */ else if (*root_y + XINT (dy) + height <= FRAME_X_DISPLAY_INFO (f)->height) /* It fits below the pointer */ *root_y += XINT (dy); @@ -4952,6 +4954,8 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) if (INTEGERP (left)) *root_x = XINT (left); + else if (*root_x + XINT (dx) <= 0) + *root_x = 0; /* Can happen for negative dx */ else if (*root_x + XINT (dx) + width <= FRAME_X_DISPLAY_INFO (f)->width) /* It fits to the right of the pointer. */ *root_x += XINT (dx); -- 2.20.1