这是indexloc提供的服务,不要输入任何密码
Skip to content

Web release build does not respond correctly to browser window resize #118

@paultallard

Description

@paultallard

A --release build for a Web target does not respond as expected to browser window size changes
Specifically, When a larger browser page is made smaller, the renderer size shrinks
to a proportional fraction of that page size. When a smaller browser page is
made larger, the renderer size grows proportionately to more than the new browser page size.
This happens on Windows 11, with Android Studio, Flutter 3.35.6, Dart 3.9.2 and three_js 0.2.5

Picture of a browser page made smaller
Image

For Windows and Android build targets, the renderer responds correctly to window size changes for both debug and release builds.
For Web targets and debug builds the renderer responds correctly.
I got the same result on several of the examples in the three_js GIT repository

I used the following to try to correct this.
I applied these to the audio/timing.dart example. All produced the same failed results.
Tried LayoutBuilder to get constraints width and height.
Tried the camera viewport size
Tried threeJS.screenSize and threeJS.renderer.setSize
Tried threeJS.onWindowResize(context)
Tried threeJS.windowResizeUpdate(Size)
Tried to shut off tree-shaking-optimizations (release specific)
One thing I noted during my testing, a windowsResizeUpdate callback fired on all of the working targets and builds but did not fire automatically for web release. I explicitly called it for web release and it did not fix the problem.
Checked for related issues (found none, closest was possibly the Multi-Views issue)
worked my way through a lot of uncertainty and self-doubt (isn't that part of the process?)

This code is the Audio/Timing example from the three_js examples and illustrates the issue:

my gist

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions