Graphics debug log: also log what is drawn, optionally to a file
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019reK4DUGYqDUjniWYJvwUW
This commit is contained in:
@@ -259,6 +259,7 @@ type coverView struct {
|
||||
*tview.Box
|
||||
style coverStyle
|
||||
gfx *kittyGraphics // real images; nil for block characters only
|
||||
lastDrawn [5]int // id, position and size of the last real image drawn, for the debug log
|
||||
cellAspect func() float64 // height of a terminal cell divided by its width
|
||||
img *image.RGBA
|
||||
note string // shown instead of the image: "loading…", "no cover"
|
||||
@@ -405,6 +406,12 @@ func (c *coverView) drawGraphics(screen tcell.Screen, x, y, cols, rows int) bool
|
||||
if err != nil {
|
||||
return false
|
||||
}
|
||||
if c.gfx.debug != nil {
|
||||
if drawn := [5]int{int(id), x, y, cols, rows}; drawn != c.lastDrawn {
|
||||
c.lastDrawn = drawn
|
||||
c.gfx.debug(fmt.Sprintf("draw: id %d at column %d, row %d over %dx%d cells", id, x, y, cols, rows))
|
||||
}
|
||||
}
|
||||
for row := 0; row < rows; row++ {
|
||||
for col := 0; col < cols; col++ {
|
||||
ch, comb, style := placeholderCell(id, row, col)
|
||||
|
||||
Reference in New Issue
Block a user