ElyPDF: old tiles stay under their page through edits and rescales until new ones land (R2.6)
This commit is contained in:
7 files changed
+250
-94
No files matched your search
@@ -41,8 +41,8 @@ pub struct PdfView {
|
||||
pub drawn: bool,
|
||||
/// Tiles the worker could not draw; not asked again.
|
||||
pub failed: HashSet<TileKey>,
|
||||
/// Tiles from before an edit: shown until their repaint lands.
|
||||
pub stale: HashSet<TileKey>,
|
||||
/// Old tiles shown under their page until covered.
|
||||
pub backdrop: Vec<crate::backdrop::Old>,
|
||||
pub text: HashMap<usize, Arc<Vec<Char>>>,
|
||||
pub asking_text: HashSet<usize>,
|
||||
pub marks: Vec<Bookmark>,
|
||||
@@ -168,7 +168,7 @@ impl PdfView {
|
||||
retired: Default::default(),
|
||||
drawn: false,
|
||||
failed: HashSet::new(),
|
||||
stale: HashSet::new(),
|
||||
backdrop: Vec::new(),
|
||||
text: HashMap::new(),
|
||||
asking_text: HashSet::new(),
|
||||
marks: loaded.marks,
|
||||
@@ -314,7 +314,9 @@ impl PdfView {
|
||||
|
||||
/// Every page tile goes; images are freed next render.
|
||||
pub fn retire_tiles(&mut self) {
|
||||
self.stale.clear();
|
||||
for old in self.backdrop.drain(..) {
|
||||
self.retired.push(old.image);
|
||||
}
|
||||
for (_, image) in self.tiles.drain() {
|
||||
self.retired.push(image);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user