fix Sprite.SetPicture once again

This commit is contained in:
faiface 2017-01-25 19:57:42 +01:00
parent cf4ab7e36a
commit 2b300b48b7
1 changed files with 1 additions and 1 deletions

View File

@ -187,7 +187,7 @@ func NewSprite(pic *Picture) *Sprite {
func (s *Sprite) SetPicture(pic *Picture) {
oldPic := s.pic
s.pic = pic
if oldPic.Bounds().Size == pic.Bounds().Size {
if oldPic != nil && oldPic.Bounds().Size == pic.Bounds().Size {
return
}
w, h := pic.Bounds().Size.XY()