Win32: redraw whole window when called with 0 width and height

This commit is contained in:
Thomas Bernard 2019-02-01 10:53:42 +01:00
parent e72bb8cab1
commit 981bcd37b4
No known key found for this signature in database
GPG Key ID: 0FF11B67A5C0863C

View File

@ -540,12 +540,20 @@ void Screen_FillRect(int x, int y, int w, int h, byte color)
void Update_rect(short x, short y, unsigned short width, unsigned short height) void Update_rect(short x, short y, unsigned short width, unsigned short height)
{ {
RECT rect; if (width == 0 && height == 0)
rect.left = x * Pixel_width; {
rect.top = y * Pixel_height; // update whole window
rect.right = (x + width) * Pixel_width; InvalidateRect(Win32_hwnd, NULL, FALSE/*TRUE*/);
rect.bottom = (y + height) * Pixel_height; }
InvalidateRect(Win32_hwnd, &rect, FALSE/*TRUE*/); else
{
RECT rect;
rect.left = x * Pixel_width;
rect.top = y * Pixel_height;
rect.right = (x + width) * Pixel_width;
rect.bottom = (y + height) * Pixel_height;
InvalidateRect(Win32_hwnd, &rect, FALSE/*TRUE*/);
}
} }
void Flush_update(void) void Flush_update(void)