mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: Bug fix: Ignore the outside size when they are 0 at Layout
Closes #1589
This commit is contained in:
parent
b8e8485fde
commit
8923ae13fe
@ -145,6 +145,11 @@ func (c *uiContext) setScreenSize(width, height int) {
|
||||
}
|
||||
|
||||
func (c *uiContext) Layout(outsideWidth, outsideHeight float64) {
|
||||
// The given outside size can be 0 e.g. just after restoring from the fullscreen mode on Windows (#1589)
|
||||
// Just ignore such cases. Otherwise, creating a zero-sized framebuffer causes a panic.
|
||||
if outsideWidth == 0 || outsideHeight == 0 {
|
||||
return
|
||||
}
|
||||
c.outsideSizeUpdated = true
|
||||
c.outsideWidth = outsideWidth
|
||||
c.outsideHeight = outsideHeight
|
||||
|
Loading…
Reference in New Issue
Block a user