mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2025-01-23 09:22:01 +01:00
restorable: Refactoring: Use InternalSize instead of NextPowerOf2Int
This commit is contained in:
parent
4e8c7f0a75
commit
a2fe3d5962
@ -191,10 +191,8 @@ func (i *Image) fill(r, g, b, a uint8) {
|
||||
|
||||
// There are not 'drawImageHistoryItem's for this image and emptyImage.
|
||||
// As emptyImage is a priority image, this is restored before other regular images are restored.
|
||||
w, h := i.Size()
|
||||
dw, dh := i.InternalSize()
|
||||
sw, sh := emptyImage.Size()
|
||||
dw := graphics.NextPowerOf2Int(w)
|
||||
dh := graphics.NextPowerOf2Int(h)
|
||||
vs := graphics.QuadVertices(dw, dh, 0, 0, sw, sh,
|
||||
float32(dw)/float32(sw), 0, 0, float32(dh)/float32(sh), 0, 0,
|
||||
rf, gf, bf, af)
|
||||
@ -205,6 +203,7 @@ func (i *Image) fill(r, g, b, a uint8) {
|
||||
}
|
||||
i.image.DrawImage(emptyImage.image, vs, is, nil, c, graphics.FilterNearest, graphics.AddressClampToZero)
|
||||
|
||||
w, h := i.Size()
|
||||
i.basePixels = &Pixels{
|
||||
color: color.RGBA{r, g, b, a},
|
||||
length: 4 * w * h,
|
||||
|
Loading…
Reference in New Issue
Block a user