shithub: puzzles

Download patch

ref: ec3d23c9d99e5233d40080623c032dfe157d29ac
parent: 6f62e91d51c1da7b6eba19fa78f5ee07de48d69d
author: Jacob Nevins <jacobn@chiark.greenend.org.uk>
date: Fri Dec 17 17:00:20 EST 2004

Add grotty casts to prevent negative -> large positive conversion of cursor
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]

--- a/windows.c
+++ b/windows.c
@@ -1017,8 +1017,8 @@
 	    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 @@
 	    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 @@
 	    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;