Fix stitched image cache generation

This commit is contained in:
David Vogel 2023-12-23 01:15:36 +01:00
parent a0d5c13557
commit 6d028d4064

View File

@ -62,9 +62,9 @@ func NewStitchedImage(tiles ImageTiles, bounds image.Rectangle, blendMethod Stit
} }
// Generate cache image rows. // Generate cache image rows.
rows := bounds.Dy() / cacheRowHeight maxRow := (bounds.Dy() - 1) / cacheRowHeight
var cacheRows []StitchedImageCache var cacheRows []StitchedImageCache
for i := 0; i < rows; i++ { for i := 0; i <= maxRow; i++ {
rect := image.Rect(bounds.Min.X, bounds.Min.Y+i*cacheRowHeight, bounds.Max.X, bounds.Min.Y+(i+1)*cacheRowHeight) rect := image.Rect(bounds.Min.X, bounds.Min.Y+i*cacheRowHeight, bounds.Max.X, bounds.Min.Y+(i+1)*cacheRowHeight)
cacheRows = append(cacheRows, NewStitchedImageCache(stitchedImage, rect.Intersect(bounds))) cacheRows = append(cacheRows, NewStitchedImageCache(stitchedImage, rect.Intersect(bounds)))
} }