fix Sprite.SetPicture once again
This commit is contained in:
parent
cf4ab7e36a
commit
2b300b48b7
|
@ -187,7 +187,7 @@ func NewSprite(pic *Picture) *Sprite {
|
||||||
func (s *Sprite) SetPicture(pic *Picture) {
|
func (s *Sprite) SetPicture(pic *Picture) {
|
||||||
oldPic := s.pic
|
oldPic := s.pic
|
||||||
s.pic = pic
|
s.pic = pic
|
||||||
if oldPic.Bounds().Size == pic.Bounds().Size {
|
if oldPic != nil && oldPic.Bounds().Size == pic.Bounds().Size {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
w, h := pic.Bounds().Size.XY()
|
w, h := pic.Bounds().Size.XY()
|
||||||
|
|
Loading…
Reference in New Issue