mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-09 01:14:24 +02:00
Windows allows windows to be resized to zero height.
Changed the window client rect validation to take this into account. Fixes https://github.com/libsdl-org/SDL/issues/9796
This commit is contained in:
@@ -330,10 +330,10 @@ void WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect)
|
||||
winrect->bottom = sdlrect->y + sdlrect->h - 1;
|
||||
}
|
||||
|
||||
BOOL WIN_IsRectEmpty(const RECT *rect)
|
||||
bool WIN_WindowRectValid(const RECT *rect)
|
||||
{
|
||||
// Calculating this manually because Xbox does not support Win32 IsRectEmpty.
|
||||
return (rect->right <= rect->left) || (rect->bottom <= rect->top);
|
||||
// A window can be resized to zero height, but not zero width
|
||||
return (rect->right > 0);
|
||||
}
|
||||
|
||||
// Some GUIDs we need to know without linking to libraries that aren't available before Vista.
|
||||
|
||||
@@ -156,8 +156,8 @@ extern BOOL WIN_IsEqualIID(REFIID a, REFIID b);
|
||||
extern void WIN_RECTToRect(const RECT *winrect, SDL_Rect *sdlrect);
|
||||
extern void WIN_RectToRECT(const SDL_Rect *sdlrect, RECT *winrect);
|
||||
|
||||
// Returns true if the rect is empty
|
||||
extern BOOL WIN_IsRectEmpty(const RECT *rect);
|
||||
// Returns false if a window client rect is not valid
|
||||
bool WIN_WindowRectValid(const RECT *rect);
|
||||
|
||||
extern SDL_AudioFormat SDL_WaveFormatExToSDLFormat(WAVEFORMATEX *waveformat);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user