diff options
Diffstat (limited to 'src/macfns.c')
| -rw-r--r-- | src/macfns.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/macfns.c b/src/macfns.c index de6a055fce6..99abc643043 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) | |||
| 3840 | 3840 | ||
| 3841 | if (INTEGERP (top)) | 3841 | if (INTEGERP (top)) |
| 3842 | *root_y = XINT (top); | 3842 | *root_y = XINT (top); |
| 3843 | else if (*root_y + XINT (dy) <= 0) | ||
| 3844 | *root_y = 0; /* Can happen for negative dy */ | ||
| 3843 | else if (*root_y + XINT (dy) + height <= FRAME_MAC_DISPLAY_INFO (f)->height) | 3845 | else if (*root_y + XINT (dy) + height <= FRAME_MAC_DISPLAY_INFO (f)->height) |
| 3844 | /* It fits below the pointer */ | 3846 | /* It fits below the pointer */ |
| 3845 | *root_y += XINT (dy); | 3847 | *root_y += XINT (dy); |
| 3846 | else if (height + XINT (dy) <= *root_y) | 3848 | else if (height + XINT (dy) <= *root_y) |
| 3847 | /* It fits above the pointer. */ | 3849 | /* It fits above the pointer. */ |
| 3848 | *root_y -= height + XINT (dy); | 3850 | *root_y -= height + XINT (dy); |
| @@ -3852,6 +3854,8 @@ compute_tip_xy (f, parms, dx, dy, width, height, root_x, root_y) | |||
| 3852 | 3854 | ||
| 3853 | if (INTEGERP (left)) | 3855 | if (INTEGERP (left)) |
| 3854 | *root_x = XINT (left); | 3856 | *root_x = XINT (left); |
| 3857 | else if (*root_x + XINT (dx) <= 0) | ||
| 3858 | *root_x = 0; /* Can happen for negative dx */ | ||
| 3855 | else if (*root_x + XINT (dx) + width <= FRAME_MAC_DISPLAY_INFO (f)->width) | 3859 | else if (*root_x + XINT (dx) + width <= FRAME_MAC_DISPLAY_INFO (f)->width) |
| 3856 | /* It fits to the right of the pointer. */ | 3860 | /* It fits to the right of the pointer. */ |
| 3857 | *root_x += XINT (dx); | 3861 | *root_x += XINT (dx); |