mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
ebiten: Refactoring: Remove uiContext.outsideSizeUpdated
This commit is contained in:
parent
42c1427c0b
commit
5031ab67a7
13
uicontext.go
13
uicontext.go
@ -35,9 +35,8 @@ type uiContext struct {
|
||||
|
||||
updateCalled bool
|
||||
|
||||
outsideSizeUpdated bool
|
||||
outsideWidth float64
|
||||
outsideHeight float64
|
||||
outsideWidth float64
|
||||
outsideHeight float64
|
||||
|
||||
err atomic.Value
|
||||
|
||||
@ -62,7 +61,6 @@ func (c *uiContext) Layout(outsideWidth, outsideHeight float64) {
|
||||
if outsideWidth == 0 || outsideHeight == 0 {
|
||||
return
|
||||
}
|
||||
c.outsideSizeUpdated = true
|
||||
c.outsideWidth = outsideWidth
|
||||
c.outsideHeight = outsideHeight
|
||||
}
|
||||
@ -77,13 +75,6 @@ func (c *uiContext) updateOffscreen() {
|
||||
d := uiDriver().DeviceScaleFactor()
|
||||
sw, sh := int(c.outsideWidth*d), int(c.outsideHeight*d)
|
||||
|
||||
if c.offscreen != nil && !c.outsideSizeUpdated {
|
||||
if w, h := c.offscreen.Size(); w == ow && h == oh {
|
||||
return
|
||||
}
|
||||
}
|
||||
c.outsideSizeUpdated = false
|
||||
|
||||
if c.screen != nil {
|
||||
if w, h := c.screen.Size(); w != sw || h != sh {
|
||||
c.screen.Dispose()
|
||||
|
Loading…
Reference in New Issue
Block a user