Skip to content

Commit

Permalink
Fixed pageIndex display by vertical reading format.
Browse files Browse the repository at this point in the history
  • Loading branch information
oolxg committed Dec 23, 2022
1 parent 1fb7ea6 commit ccbcc86
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 6 deletions.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct OfflineMangaReadingFeature: ReducerProtocol {
let pagesCount: Int
var pageIndex = 0
var pageIndexToDisplay: Int? {
if pageIndex > mostLeftPageIndex && pageIndex < mostRightPageIndex {
if pageIndex > mostLeftPageIndex && pageIndex < mostRightPageIndex, readingFormat != .vertical {
return readingFormat == .rightToLeft ? pagesCount - pageIndex : pageIndex + 1
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ extension OfflineMangaReadingView {
.disabled(true)
}
}
.frame(height: 60)
.frame(height: 40)

Spacer()

Expand Down Expand Up @@ -231,7 +231,6 @@ extension OfflineMangaReadingView {
Image(systemName: "xmark")
.font(.title3)
.foregroundColor(.theme.foreground)
.padding(.vertical)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ struct OnlineMangaReadingFeature: ReducerProtocol {
var pageIndex = 0
// need this var for avoiding computations of page index when `readMangaRightToLeft` is set to true
var pageIndexToDisplay: Int? {
if let pagesCount, pageIndex > mostLeftPageIndex && pageIndex < mostRightPageIndex {
if let pagesCount, pageIndex > mostLeftPageIndex
&& pageIndex < mostRightPageIndex, readingFormat != .vertical {
return readingFormat == .rightToLeft ? pagesCount - pageIndex : pageIndex + 1
}
return nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,6 @@ extension OnlineMangaReadingView {
Image(systemName: "xmark")
.font(.title3)
.foregroundColor(.theme.foreground)
.padding(.vertical)
}
}

Expand Down Expand Up @@ -171,7 +170,7 @@ extension OnlineMangaReadingView {
.disabled(true)
}
}
.frame(height: 60)
.frame(height: 40)

Spacer()

Expand Down

0 comments on commit ccbcc86

Please sign in to comment.