-
-
Notifications
You must be signed in to change notification settings - Fork 25
Open
Description
The attached images show a BlazorGL game rendered in Safari on iOS. The red rectangle should be completely visible around the edge of the browser viewport.
The first image shows the rectangle cut off at the bottom when the game is initially loaded due to the client bounds being too large.
The second image shows the full red rectangle inside the viewport as expected after rotating the device to landscape orientation and back to portrait, which triggers a window resize that fixes the window client bounds.
As a workaround, you can invoke BlazorGameWindow.OnResize on game initialization, e.g.:
((BlazorGameWindow)this.Window).OnResize(null)
The OnResize method is internal, so you can invoke it via reflection, e.g.,:
var windowOnResizeMethod = ((BlazorGameWindow)this.Window).GetType().GetMethod(@"OnResize", BindingFlags.NonPublic | BindingFlags.Instance, [typeof(object)]);
windowOnResizeMethod.Invoke(this.Window, [null]);
Note that the same issue exists on Chrome for iOS as well.

Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels