diff --git a/Source/Client/Browser/BrowserWindowSizing.cpp b/Source/Client/Browser/BrowserWindowSizing.cpp index f54441253..a7a43d68b 100644 --- a/Source/Client/Browser/BrowserWindowSizing.cpp +++ b/Source/Client/Browser/BrowserWindowSizing.cpp @@ -1,31 +1,5 @@ #include "Client/Browser/WebBrowser.h" -// OFFSET: 0x00AB3060 -// FUNCTION: fn_17421 -void CWebBrowser::Resize(int requestedWidth, int requestedHeight) { - if (!this->browser) { - return; - } - - this->width = requestedWidth == this->screenWidth ? requestedWidth - 1 : requestedWidth; - int height = requestedHeight == this->screenHeight ? requestedHeight - 1 : requestedHeight; - - int toolbarHeight = 0; - if (this->rebar && this->auxiliaryVisible != 0) { - RECT rectangle; - GetClientRect(this->rebar, &rectangle); - toolbarHeight = rectangle.bottom - rectangle.top + 4; - } - - this->height = height - toolbarHeight; - this->browser->put_Width(this->width); - this->browser->put_Height(this->height); - - if (this->rebar) { - SetWindowPos(this->rebar, nullptr, 0, 0, requestedWidth, requestedHeight, SWP_NOMOVE); - } -} - // INLINED int CWebBrowser::AuxiliaryHeight() { if (this->rebar && this->auxiliaryVisible != 0) { @@ -37,6 +11,24 @@ int CWebBrowser::AuxiliaryHeight() { return 0; } +// OFFSET: 0x00AB3060 +// FUNCTION: fn_17421 +void CWebBrowser::Resize(int requestedWidth, int requestedHeight) { + if (!this->browser) { + return; + } + + this->width = this->screenWidth != requestedWidth ? requestedWidth : requestedWidth - 1; + const int height = this->screenHeight != requestedHeight ? requestedHeight : requestedHeight - 1; + this->height = height - this->AuxiliaryHeight(); + this->browser->put_Width(this->width); + this->browser->put_Height(this->height); + + if (this->rebar) { + SetWindowPos(this->rebar, nullptr, 0, 0, requestedWidth, requestedHeight, SWP_NOMOVE); + } +} + // OFFSET: 0x00AB3120 // FUNCTION: fn_17422 void CWebBrowser::ShowAuxiliary(unsigned char value) { @@ -55,7 +47,9 @@ void CWebBrowser::ShowAuxiliary(unsigned char value) { if (this->externalEvents) { RECT rectangle; GetWindowRect(this->host, &rectangle); - POINT origin{}; + POINT origin; + origin.x = 0; + origin.y = 0; ClientToScreen(this->host, &origin); this->browser->put_Left(-origin.x); }