image: Bug fix: isDisposed misimplementation

This commit is contained in:
Hajime Hoshi 2016-02-07 03:20:52 +09:00
parent d2bce0b9c1
commit eb9379c3a6

View File

@ -162,7 +162,10 @@ func (i *Image) Dispose() error {
}
func (i *Image) isDisposed() bool {
return i.texture == nil
// i.texture can be nil even when the image is not disposed,
// so we need to check if both are nil.
// See graphicsContext.setSize function.
return i.texture == nil && i.framebuffer == nil
}
// ReplacePixels replaces the pixels of the image with p.