restorable: Bug fix: commands must be flushed at At

This commit is contained in:
Hajime Hoshi 2018-03-25 01:26:43 +09:00
parent 8149ace52c
commit 99f72a1b64

View File

@ -198,6 +198,9 @@ func (i *Image) At(x, y int) (color.RGBA, error) {
if x < 0 || y < 0 || w <= x || h <= y {
return color.RGBA{}, nil
}
if err := graphics.FlushCommands(); err != nil {
return color.RGBA{}, err
}
if i.basePixels == nil || i.drawImageHistory != nil || i.stale {
if err := i.readPixelsFromGPU(); err != nil {
return color.RGBA{}, err