M5: opening, closing or moving a pop-up keeps the page's raster (#2137)

Review on #2137 (nitpick): a SetAnnotationPopup edit marked its page
stale, so its tiles were rendered again, its text cache dropped and its
selection cleared, though nothing in the raster changes: the window is
drawn over the page and a /Popup annotation paints nothing. Edits that
also change the comment (a batch) still invalidate as before.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Pq7HyCfwzyRXj4VfQAVVdv
This commit is contained in:
mtlcl410andClaude Opus 5.5 committed 2026-11-01 09:16:03 +08:00
1 parent 6aea7318f3
commit 002b7bf4ff
1 file changed
+6 -2
+6 -2
View File
@@ -146,8 +146,12 @@ impl PdfCraftApp {
view.move_background.committed(&edit, doc.edit_generation());
view.text_background.committed(&edit);
if let Some(page) = comment_page(&edit).or_else(|| content_page(&edit)) {
// Comment and content edits change one page: keep every other raster.
view.page_changed(page);
// Comment and content edits change one page: keep every other raster. Opening,
// closing or moving a pop-up changes none: the window is drawn over the page, and
// a /Popup annotation paints nothing in the raster (ISO 32000-2 §12.5.6.14).
if !matches!(edit, Edit::SetAnnotationPopup { .. }) {
view.page_changed(page);
}
} else if let Some(form_before) = form_before
&& doc.info.pages.len() == page_count_before
&& doc.xfa.is_some() == had_xfa