mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-11-10 04:57:26 +01:00
restorable: Add padding when renderingn the empty image
This commit is contained in:
parent
5c4740c294
commit
a1abe6b728
@ -255,7 +255,8 @@ func fillImage(i *graphicscommand.Image, clr color.RGBA) {
|
||||
// TODO: Can we unexport InternalSize()?
|
||||
dw, dh := i.InternalSize()
|
||||
sw, sh := emptyImage.image.InternalSize()
|
||||
vs := quadVertices(0, 0, float32(dw), float32(dh), 0, 0, float32(sw), float32(sh), rf, gf, bf, af)
|
||||
// Add 1 pixels for paddings.
|
||||
vs := quadVertices(0, 0, float32(dw), float32(dh), 1, 1, float32(sw-1), float32(sh-1), rf, gf, bf, af)
|
||||
is := graphics.QuadIndices()
|
||||
|
||||
i.DrawTriangles(emptyImage.image, vs, is, nil, compositemode, driver.FilterNearest, driver.AddressUnsafe, nil, nil)
|
||||
|
Loading…
Reference in New Issue
Block a user