internal/atlas: refactoring: rename a variable

This commit is contained in:
Hajime Hoshi 2023-08-19 05:20:39 +09:00
parent 3c49f81b5c
commit be68f50f96

View File

@ -68,10 +68,10 @@ func putImagesOnSourceBackend(graphicsDriver graphicsdriver.Graphics) {
// The counter usedAsDestinationCount is updated at most once per frame (#2676). // The counter usedAsDestinationCount is updated at most once per frame (#2676).
for i := range imagesUsedAsDestination { for i := range imagesUsedAsDestination {
// This counter is not updated when the backend is created in this frame. // This counter is not updated when the backend is created in this frame.
if !i.backendJustCreated && i.usedAsDestinationCount < math.MaxInt { if !i.backendCreatedInThisFrame && i.usedAsDestinationCount < math.MaxInt {
i.usedAsDestinationCount++ i.usedAsDestinationCount++
} }
i.backendJustCreated = false i.backendCreatedInThisFrame = false
delete(imagesUsedAsDestination, i) delete(imagesUsedAsDestination, i)
} }
@ -164,8 +164,8 @@ type Image struct {
imageType ImageType imageType ImageType
disposed bool disposed bool
backend *backend backend *backend
backendJustCreated bool backendCreatedInThisFrame bool
node *packing.Node node *packing.Node
@ -239,7 +239,7 @@ func (i *Image) ensureIsolatedFromSource(backends []*backend) {
} }
} }
i.allocate(bs, false) i.allocate(bs, false)
i.backendJustCreated = true i.backendCreatedInThisFrame = true
return return
} }