From 4849f3de54a47d440d4ba7adf1ad442b4ced8609 Mon Sep 17 00:00:00 2001 From: Toni Spets Date: Mon, 8 Nov 2010 17:49:09 +0200 Subject: [PATCH] Fix C&C scrolling issue, the screen edges were one pixel off --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 08ddbbc..7401463 100644 --- a/main.c +++ b/main.c @@ -223,8 +223,8 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) if(ddraw->cursor.x < 0) ddraw->cursor.x = 0; if(ddraw->cursor.y < 0) ddraw->cursor.y = 0; - if(ddraw->cursor.x > ddraw->width) ddraw->cursor.x = ddraw->width; - if(ddraw->cursor.y > ddraw->height) ddraw->cursor.y = ddraw->height; + if(ddraw->cursor.x > ddraw->width-1) ddraw->cursor.x = ddraw->width-1; + if(ddraw->cursor.y > ddraw->height-1) ddraw->cursor.y = ddraw->height-1; SetCursorPos(ddraw->center.x, ddraw->center.y); }