mirror of
https://github.com/raysan5/raylib.git
synced 2026-01-13 19:05:15 +00:00
Fix window width calculation by adding wOffset (#5457)
This commit is contained in:
parent
9b183e0c5e
commit
e534f14419
5
src/external/RGFW.h
vendored
5
src/external/RGFW.h
vendored
@ -6522,8 +6522,8 @@ LRESULT CALLBACK WndProcW(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
|
||||
if (win->src.aspectRatio.w != 0 && win->src.aspectRatio.h != 0) {
|
||||
double aspectRatio = (double)win->src.aspectRatio.w / win->src.aspectRatio.h;
|
||||
|
||||
int width = windowRect.right - windowRect.left;
|
||||
int height = windowRect.bottom - windowRect.top;
|
||||
int width = (windowRect.right - windowRect.left) - win->src.wOffset;
|
||||
int height = (windowRect.bottom - windowRect.top) - win->src.hOffset;
|
||||
int newHeight = (int)(width / aspectRatio);
|
||||
int newWidth = (int)(height * aspectRatio);
|
||||
|
||||
@ -6968,6 +6968,7 @@ RGFW_window* RGFW_createWindowPtr(const char* name, RGFW_rect rect, RGFW_windowF
|
||||
DestroyWindow(dummyWin);
|
||||
|
||||
win->src.hOffset = (u32)(windowRect.bottom - windowRect.top) - (u32)(clientRect.bottom - clientRect.top);
|
||||
win->src.wOffset = (u32)(windowRect.right - windowRect.left) - (u32)(clientRect.right - clientRect.left);
|
||||
win->src.window = CreateWindowW(Class.lpszClassName, (wchar_t*)wide_name, window_style, win->r.x, win->r.y, win->r.w, win->r.h + (i32)win->src.hOffset, 0, 0, inh, 0);
|
||||
SetPropW(win->src.window, L"RGFW", win);
|
||||
RGFW_window_resize(win, RGFW_AREA(win->r.w, win->r.h)); /* so WM_GETMINMAXINFO gets called again */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user