fix(composite): don't draw partially off-screen images (prevents sticky images on scroll)

This commit is contained in:
Mortdecai
2026-04-07 22:29:20 -04:00
parent 8e663b6e63
commit f7c619457b
+4 -4
View File
@@ -273,11 +273,11 @@ func (cc *compositeContent) drawImage(ctx *ui.Context, idx, row, width, height i
graphic.Resize(width, height)
}
startRow := row
if startRow < 0 {
startRow = 0
// Only draw when fully on-screen — partial placement causes sticky images
if row < 0 || row+height > ctx.Height() {
return
}
win := ctx.Window().New(0, startRow, width, height)
win := ctx.Window().New(0, row, width, height)
graphic.Draw(win)
}