Skip to content

Repaint when the picture changed and nothing else did - #842

Merged
SimonCropp merged 2 commits into
mainfrom
fix-stale-image-pane
Aug 23, 2026
Merged

Repaint when the picture changed and nothing else did#842
SimonCropp merged 2 commits into
mainfrom
fix-stale-image-pane

Conversation

@SimonCropp

Copy link
Copy Markdown
Member

The Windows head repaints only when the new screen differs from the last one,
because ScreenBuilder allocates a fresh Screen every frame and record equality
would repaint sixty times a second. That comparison never looked at the image
pane, and an image pane said only where the file was and how big it was.

An image side's rows are format, dimensions and byte count, so a re-run that
rewrites a received image at the same size changes nothing in the model - for BMP,
being uncompressed, that is every re-run. Apply returned before invalidating, the
canvas never repainted, and the pane kept the previous picture. The stamp based
freshness check in ImageCache was never even consulted, since nothing asked it to
paint.

ImagePane carries the content hash the model already had, and the pane comparison
includes the image. The hash is not for drawing - a head reads the file - but for
telling one picture from another at the same path and size.

The Windows head repaints only when the new screen differs from the last one,
because ScreenBuilder allocates a fresh Screen every frame and record equality
would repaint sixty times a second. That comparison never looked at the image
pane, and an image pane said only where the file was and how big it was.

An image side's rows are format, dimensions and byte count, so a re-run that
rewrites a received image at the same size changes nothing in the model - for BMP,
being uncompressed, that is every re-run. Apply returned before invalidating, the
canvas never repainted, and the pane kept the previous picture. The stamp based
freshness check in ImageCache was never even consulted, since nothing asked it to
paint.

ImagePane carries the content hash the model already had, and the pane comparison
includes the image. The hash is not for drawing - a head reads the file - but for
telling one picture from another at the same path and size.
@SimonCropp
SimonCropp merged commit 10774b8 into main Aug 23, 2026
8 checks passed
@SimonCropp
SimonCropp deleted the fix-stale-image-pane branch August 23, 2026 09:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant