Win32: redraw whole window when called with 0 width and height
This commit is contained in:
parent
e72bb8cab1
commit
981bcd37b4
@ -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)
|
||||||
{
|
{
|
||||||
|
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;
|
||||||
rect.top = y * Pixel_height;
|
rect.top = y * Pixel_height;
|
||||||
rect.right = (x + width) * Pixel_width;
|
rect.right = (x + width) * Pixel_width;
|
||||||
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)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user