restorable: Add padding when renderingn the empty image

This commit is contained in:
Hajime Hoshi 2020-06-26 14:01:49 +09:00
parent 5c4740c294
commit a1abe6b728

View File

@ -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)