mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
parent
b5ddee3e4a
commit
c5867c3357
@ -283,7 +283,16 @@ func (c *context) layoutGame(outsideWidth, outsideHeight float64, deviceScaleFac
|
|||||||
c.outsideWidth = outsideWidth
|
c.outsideWidth = outsideWidth
|
||||||
c.outsideHeight = outsideHeight
|
c.outsideHeight = outsideHeight
|
||||||
|
|
||||||
ow, oh := c.game.Layout(int(outsideWidth), int(outsideHeight))
|
// Adjust the outside size to integer values.
|
||||||
|
// Even if the original value is less than 1, the value must be a positive integer (#2340).
|
||||||
|
iow, ioh := int(outsideWidth), int(outsideHeight)
|
||||||
|
if iow == 0 {
|
||||||
|
iow = 1
|
||||||
|
}
|
||||||
|
if ioh == 0 {
|
||||||
|
ioh = 1
|
||||||
|
}
|
||||||
|
ow, oh := c.game.Layout(iow, ioh)
|
||||||
if ow <= 0 || oh <= 0 {
|
if ow <= 0 || oh <= 0 {
|
||||||
panic("ui: Layout must return positive numbers")
|
panic("ui: Layout must return positive numbers")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user