Change history of page and maxPage (#216)

This commit is contained in:
角砂糖
2025-02-21 09:12:53 +08:00
committed by GitHub
parent 24b7319bb5
commit 7b601058eb

View File

@@ -258,9 +258,15 @@ class _ReaderState extends State<Reader> with _ReaderLocation, _ReaderWindow {
void updateHistory() {
if (history != null) {
history!.page = page;
if(page == maxPage){
/// Record the last image of chapter
history!.page = images?.length ?? 1;
} else {
/// Record the first image of the page
history!.page = (page-1) * imagesPerPage + 1;
}
if (maxPage > 1) {
history!.maxPage = maxPage;
history!.maxPage = images?.length ?? 1;
}
if (widget.chapters?.isGrouped ?? false) {
int g = 0;