Skip to content

Commit

Permalink
clean render cache on testcanvas.Refresh()
Browse files Browse the repository at this point in the history
  • Loading branch information
elliot-aeroqual committed Feb 8, 2023
1 parent 4744d19 commit 416c1b7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/testcanvas.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"fyne.io/fyne/v2/driver/desktop"
"fyne.io/fyne/v2/internal"
"fyne.io/fyne/v2/internal/app"
"fyne.io/fyne/v2/internal/cache"
"fyne.io/fyne/v2/theme"
)

Expand Down Expand Up @@ -88,6 +89,7 @@ func NewTransparentCanvasWithPainter(painter SoftwarePainter) WindowlessCanvas {
}

func (c *testCanvas) Capture() image.Image {
cache.Clean(true)
bounds := image.Rect(0, 0, internal.ScaleInt(c, c.Size().Width), internal.ScaleInt(c, c.Size().Height))
img := image.NewNRGBA(bounds)
if !c.transparent {
Expand Down

0 comments on commit 416c1b7

Please sign in to comment.