chiark / gitweb /
Add grotty casts to prevent negative -> large positive conversion of cursor
authorJacob Nevins <jacobn@chiark.greenend.org.uk>
Fri, 17 Dec 2004 22:00:20 +0000 (22:00 +0000)
committerJacob Nevins <jacobn@chiark.greenend.org.uk>
Fri, 17 Dec 2004 22:00:20 +0000 (22:00 +0000)
position in Windows frontend; this showed up as a UI glitch while dragging to
the left/top of the window in Rectangles.

[originally from svn r5007]

windows.c

index 9fa6c95784f8810f6a67e39c6ef126289e98e9a1..494caae7bcb5a28c65d8476112a931ce84df0faa 100644 (file)
--- a/windows.c
+++ b/windows.c
@@ -1017,8 +1017,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
            else
                button = RIGHT_BUTTON;
 
-           if (!midend_process_key(fe->me, LOWORD(lParam),
-                                   HIWORD(lParam), button))
+           if (!midend_process_key(fe->me, (signed short)LOWORD(lParam),
+                                   (signed short)HIWORD(lParam), button))
                PostQuitMessage(0);
 
            SetCapture(hwnd);
@@ -1042,8 +1042,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
            else
                button = RIGHT_RELEASE;
 
-           if (!midend_process_key(fe->me, LOWORD(lParam),
-                                   HIWORD(lParam), button))
+           if (!midend_process_key(fe->me, (signed short)LOWORD(lParam),
+                                   (signed short)HIWORD(lParam), button))
                PostQuitMessage(0);
 
            ReleaseCapture();
@@ -1060,8 +1060,8 @@ static LRESULT CALLBACK WndProc(HWND hwnd, UINT message,
            else
                button = RIGHT_DRAG;
            
-           if (!midend_process_key(fe->me, LOWORD(lParam),
-                                   HIWORD(lParam), button))
+           if (!midend_process_key(fe->me, (signed short)LOWORD(lParam),
+                                   (signed short)HIWORD(lParam), button))
                PostQuitMessage(0);
        }
        break;