mirror of
https://github.com/raysan5/raylib.git
synced 2025-09-05 19:08:13 +00:00
use parentElement's dimensions for width/height
This commit is contained in:
@@ -1681,9 +1681,9 @@ static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *
|
|||||||
|
|
||||||
// This event is called whenever the window changes sizes,
|
// This event is called whenever the window changes sizes,
|
||||||
// so the size of the canvas object is explicitly retrieved below
|
// so the size of the canvas object is explicitly retrieved below
|
||||||
int width = EM_ASM_INT( return window.innerWidth; );
|
int width = EM_ASM_INT( return (!!document.fullscreenElement) ? window.innerWidth : Module.canvas.parentElement.clientWidth; );
|
||||||
int height = EM_ASM_INT( return window.innerHeight; );
|
int height = EM_ASM_INT( return (!!document.fullscreenElement) ? window.innerHeight : Module.canvas.parentElement.clientHeight; );
|
||||||
|
|
||||||
if (width < (int)CORE.Window.screenMin.width) width = CORE.Window.screenMin.width;
|
if (width < (int)CORE.Window.screenMin.width) width = CORE.Window.screenMin.width;
|
||||||
else if ((width > (int)CORE.Window.screenMax.width) && (CORE.Window.screenMax.width > 0)) width = CORE.Window.screenMax.width;
|
else if ((width > (int)CORE.Window.screenMax.width) && (CORE.Window.screenMax.width > 0)) width = CORE.Window.screenMax.width;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user