images are likely rgba
This commit is contained in:
parent
3e6e46ca0d
commit
e3098ff636
1 changed files with 2 additions and 2 deletions
|
@ -26,7 +26,7 @@ func (cv *Canvas) reduceCache(keepSize int) {
|
||||||
var total int
|
var total int
|
||||||
for _, img := range cv.images {
|
for _, img := range cv.images {
|
||||||
w, h := img.img.Size()
|
w, h := img.img.Size()
|
||||||
total += w * h
|
total += w * h * 4
|
||||||
}
|
}
|
||||||
if total <= keepSize {
|
if total <= keepSize {
|
||||||
return
|
return
|
||||||
|
@ -44,7 +44,7 @@ func (cv *Canvas) reduceCache(keepSize int) {
|
||||||
pos++
|
pos++
|
||||||
delete(cv.images, img.src)
|
delete(cv.images, img.src)
|
||||||
w, h := img.img.Size()
|
w, h := img.img.Size()
|
||||||
total -= w * h
|
total -= w * h * 4
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue