Fix invalid total page count. Close #348

This commit is contained in:
2025-04-28 20:18:29 +08:00
parent 929c1a9d91
commit bf7b90313a
2 changed files with 14 additions and 6 deletions

View File

@@ -119,7 +119,7 @@ class _GalleryModeState extends State<_GalleryMode>
/// [totalPages] is the total number of pages in the current chapter.
/// More than one images can be displayed on one page.
int get totalPages {
if (!showSingleImageOnFirstPage) {
if (!reader.showSingleImageOnFirstPage) {
return (reader.images!.length / reader.imagesPerPage).ceil();
} else {
return 1 +
@@ -144,11 +144,9 @@ class _GalleryModeState extends State<_GalleryMode>
super.initState();
}
bool get showSingleImageOnFirstPage => appdata.settings["showSingleImageOnFirstPage"];
/// Get the range of images for the given page. [page] is 1-based.
(int start, int end) getPageImagesRange(int page) {
if (showSingleImageOnFirstPage) {
if (reader.showSingleImageOnFirstPage) {
if (page == 1) {
return (0, 1);
} else {