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

@ -539,6 +539,13 @@ 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)
{
if (width == 0 && height == 0)
{
// update whole window
InvalidateRect(Win32_hwnd, NULL, FALSE/*TRUE*/);
}
else
{ {
RECT rect; RECT rect;
rect.left = x * Pixel_width; rect.left = x * Pixel_width;
@ -547,6 +554,7 @@ void Update_rect(short x, short y, unsigned short width, unsigned short height)
rect.bottom = (y + height) * Pixel_height; rect.bottom = (y + height) * Pixel_height;
InvalidateRect(Win32_hwnd, &rect, FALSE/*TRUE*/); InvalidateRect(Win32_hwnd, &rect, FALSE/*TRUE*/);
} }
}
void Flush_update(void) void Flush_update(void)
{ {