add mouse flicks to the gif filmstrip

This commit is contained in:
2026-11-03 21:06:00 +02:00
parent 15d2074393
commit 9b31e2daa9
5 changed files with 443 additions and 80 deletions
+6 -1
View File
@@ -1146,9 +1146,14 @@ pub(crate) fn extract_thumbnails(
drop(std::fs::remove_file(extra));
}
}
// Keep both sides of a page boundary available while scrolling.
for entry in std::fs::read_dir(out_dir)?.flatten() {
let path = entry.path();
if path != page_dir && entry.file_type().is_ok_and(|kind| kind.is_dir()) {
let name = entry.file_name();
let nearby = name.to_str().and_then(|name| name.split_once('-'))
.and_then(|(rate, offset)| Some((rate.parse::<u32>().ok()?, offset.parse::<u32>().ok()?)))
.is_some_and(|(rate, offset)| rate == fps && offset.abs_diff(start) <= PAGE_SIZE as u32 * 2);
if !nearby && entry.file_type().is_ok_and(|kind| kind.is_dir()) {
drop(std::fs::remove_dir_all(path));
}
}