summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScrotadamus <scrotadamus@insiberia.net>2025-03-07 17:51:42 +0100
committerScrotadamus <scrotadamus@insiberia.net>2025-03-07 17:51:42 +0100
commit847947c145d1d1283cb53962b0e7f02149c6ed13 (patch)
tree56e7b1f2a4b8546c28eea8f352609f921f122ff8
parent30417cde4c7353a6c8e960f6be84a6c76c512e60 (diff)
fixed bug on scrollTo()HEADmaster
- fixed bug on scrollTo() - refactored b.currentDoc().getCurrentPage() into b.currentPage()
-rw-r--r--cmd/browse.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/cmd/browse.go b/cmd/browse.go
index a6abac0..55f290c 100644
--- a/cmd/browse.go
+++ b/cmd/browse.go
@@ -191,6 +191,10 @@ func newAcc(acc int) int {
return acc
}
+func (b *Browser) currentPage() int {
+ return b.currentDoc().getCurrentPage()
+}
+
func (b *Browser) nextDoc(acc int) {
acc = newAcc(acc)
// todo implement
@@ -204,14 +208,12 @@ func (b *Browser) prevDoc(acc int) {
func (b *Browser) nextPage(acc int) {
b.resetAccumulator()
acc = newAcc(acc)
- currentPage := b.currentDoc().getCurrentPage()
- b.updatePage(currentPage + acc)
+ b.updatePage(b.currentPage() + acc)
}
func (b *Browser) prevPage(acc int) {
b.resetAccumulator()
acc = newAcc(acc)
- currentPage := b.currentDoc().getCurrentPage()
- b.updatePage(currentPage - acc)
+ b.updatePage(b.currentPage() - acc)
}
func (b *Browser) scrollUp(acc int) {
@@ -224,7 +226,7 @@ func (b *Browser) scrollUp(acc int) {
func (b *Browser) scrollDown(acc int) {
b.resetAccumulator()
acc = newAcc(acc)
- b.pageContent.ScrollTo(acc, 0)
+ b.pageContent.ScrollTo(-acc, 0)
b.updateStatus()
}