You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I can't seem to resize the viewport with gomobile. It's cumbersome to manually drag the corner of the viewport to match the screen size of an iPhone, so I'm hoping to do it programmatically, but the events seem to be getting overruled.
I ran gomobile build and executed the binary and expected to see a viewport 400px wide by 800px tall. Instead, I always get the default 800x800px viewport. I do not have a device plugged in. Debugging the Events() channel, it looks like 3 Size Events are automatically run after my Size event is processed:
I also tried setting the viewport using the Viewport() function from https://godoc.org/golang.org/x/mobile/gl#Context, but that did not work either. It appears that an 800x800px viewport is somehow registered into the startup process and there doesn't appear to be an easy way to change that, or am I missing something?
By viewport, I assume you're referring to the actual window size. Sending a size.Event will not affect the window size, nor does glViewport. Currently, the window size hints are hardcoded.
ghost
changed the title
x/mobile: Viewport always 800x800px
x/mobile: Window always 800x800px
Jun 2, 2016
Is there a reason it's hard coded, or is this a good candidate for a patch? I'm interested in developing with GoMobile, but without having a way to adjust the window size to fit common device sizes makes testing difficult.
I can't seem to resize the viewport with gomobile. It's cumbersome to manually drag the corner of the viewport to match the screen size of an iPhone, so I'm hoping to do it programmatically, but the events seem to be getting overruled.
I ran
gomobile build
and executed the binary and expected to see a viewport 400px wide by 800px tall. Instead, I always get the default 800x800px viewport. I do not have a device plugged in. Debugging the Events() channel, it looks like 3 Size Events are automatically run after my Size event is processed:I also tried setting the viewport using the Viewport() function from https://godoc.org/golang.org/x/mobile/gl#Context, but that did not work either. It appears that an 800x800px viewport is somehow registered into the startup process and there doesn't appear to be an easy way to change that, or am I missing something?
The text was updated successfully, but these errors were encountered: