浏览代码

use parentElement's dimensions for width/height

pull/4945/head
Moros Smith 4 个月前
父节点
当前提交
b618d7b35b
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. +3
    -3
      src/platforms/rcore_web.c

+ 3
- 3
src/platforms/rcore_web.c 查看文件

@ -1681,9 +1681,9 @@ static EM_BOOL EmscriptenResizeCallback(int eventType, const EmscriptenUiEvent *
// This event is called whenever the window changes sizes,
// so the size of the canvas object is explicitly retrieved below
int width = EM_ASM_INT( return window.innerWidth; );
int height = EM_ASM_INT( return window.innerHeight; );
int width = EM_ASM_INT( return p">(!!document.fullscreenElement) ? window.l">innerWidth : Module.canvas.parentElement.clientWidth; );
int height = EM_ASM_INT( return p">(!!document.fullscreenElement) ? window.l">innerHeight : Module.canvas.parentElement.clientHeight; );
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;

正在加载...
取消
保存