Review comments

This commit is contained in:
jpirnay
2026-04-26 17:57:26 +02:00
parent 812269057d
commit edf7ce1ae2
10 changed files with 85 additions and 48 deletions
@@ -897,6 +897,10 @@ void MdReaderActivity::savePageIndexCache() const {
void MdReaderActivity::onButtonAction(const CrossPointSettings::BUTTON_ACTION action) {
using BA = CrossPointSettings::BUTTON_ACTION;
auto clampPage = [this]() {
if (totalPages == 0) {
currentPage = 0;
return;
}
if (currentPage < 0) currentPage = 0;
if (currentPage >= totalPages) currentPage = totalPages - 1;
};