Skip to content

Commit

Permalink
Don't continue refreshing images when there is no content to render
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Nov 30, 2024
1 parent e8be3f6 commit 4fa185d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion canvas/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,9 @@ func (i *Image) Hide() {
// MinSize returns the specified minimum size, if set, or {1, 1} otherwise.
func (i *Image) MinSize() fyne.Size {
if i.Image == nil || i.aspect == 0 {
i.Refresh()
if i.File != "" || i.Resource != nil {
i.Refresh()
}
}
return i.baseObject.MinSize()
}
Expand Down Expand Up @@ -134,6 +136,8 @@ func (i *Image) Refresh() {
return
}
rc = io.NopCloser(r)
} else {
return
}

if i.File != "" || i.Resource != nil {
Expand Down

0 comments on commit 4fa185d

Please sign in to comment.