summaryrefslogtreecommitdiff
path: root/src/w32fns.c
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2005-12-12 09:32:59 +0000
committerJan Djärv <jan.h.d@swipnet.se>2005-12-12 09:32:59 +0000
commit7e8410d1abe43466b20aec2f72e075403c948bbb (patch)
tree683b68649cc1618d73954a3f7556796c113ae87d /src/w32fns.c
parent57134802f74ad81aa28a46ba0485aac5f59c65a5 (diff)
downloademacs-7e8410d1abe43466b20aec2f72e075403c948bbb.tar.gz
* (compute_tip_xy): Calculate root_y the same way as root_x,
i.e. dy is offset from top of frame instead of bottom.
Diffstat (limited to 'src/w32fns.c')
-rw-r--r--src/w32fns.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/src/w32fns.c b/src/w32fns.c
index d1e4e49bb03..647267972dc 100644
--- a/src/w32fns.c
+++ b/src/w32fns.c
@@ -7411,16 +7411,15 @@ 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) - height < 0)
- *root_y -= XINT (dy);
- /* If there's not enough place below the pointer, put tip above it. */
- else if (*root_y + XINT (dy) >= FRAME_W32_DISPLAY_INFO (f)->height)
- *root_y -= XINT (dy);
- else
- {
- *root_y -= height;
+ else if (*root_y + XINT (dy) + height <= FRAME_W32_DISPLAY_INFO (f)->height)
+ /* It fits below the pointer */
*root_y += XINT (dy);
- }
+ else if (height + XINT (dy) <= *root_y)
+ /* It fits above the pointer. */
+ *root_y -= height + XINT (dy);
+ else
+ /* Put it on the top. */
+ *root_y = 0;
if (INTEGERP (left))
*root_x = XINT (left);