mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 19:58:54 +01:00
graphics: Swap error checking
This commit is contained in:
parent
d60f662f57
commit
046a6cd014
6
image.go
6
image.go
@ -149,12 +149,12 @@ func (i *Image) isDisposed() bool {
|
|||||||
// DrawImage always returns nil as of 1.5.0-alpha.
|
// DrawImage always returns nil as of 1.5.0-alpha.
|
||||||
func (i *Image) DrawImage(img *Image, options *DrawImageOptions) error {
|
func (i *Image) DrawImage(img *Image, options *DrawImageOptions) error {
|
||||||
i.copyCheck()
|
i.copyCheck()
|
||||||
if i == img {
|
|
||||||
panic("ebiten: Image.DrawImage: img must be different from the receiver")
|
|
||||||
}
|
|
||||||
if img.isDisposed() {
|
if img.isDisposed() {
|
||||||
panic("ebiten: the given image to DrawImage must not be disposed")
|
panic("ebiten: the given image to DrawImage must not be disposed")
|
||||||
}
|
}
|
||||||
|
if i == img {
|
||||||
|
panic("ebiten: Image.DrawImage: img must be different from the receiver")
|
||||||
|
}
|
||||||
if i.isDisposed() {
|
if i.isDisposed() {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user