Review updates

This commit is contained in:
jpirnay
2026-05-07 08:38:23 +02:00
parent 4f140afd10
commit f127ec8f9e
3 changed files with 6 additions and 3 deletions
+3 -1
View File
@@ -1867,8 +1867,10 @@ bool EpubReaderActivity::drawCurrentPageToBuffer(const std::string& filePath, Gf
return false;
}
const int imageOnlyOffset = getImageOnlyPageYOffset(*page, viewportHeight);
const int renderMarginTop = marginTop + imageOnlyOffset;
renderer.clearScreen();
page->render(renderer, effectiveFontId, marginLeft, marginTop);
page->render(renderer, effectiveFontId, marginLeft, renderMarginTop);
// No displayBuffer call — caller (SleepActivity) handles that after compositing the overlay
return true;
}
@@ -51,7 +51,7 @@ void drawPreviewProgressBar(const GfxRenderer& renderer, const Rect& rect, const
}
const int percent = progressBar == CrossPointSettings::STATUS_BAR_PROGRESS_BAR::BOOK_PROGRESS ? 75 : 25;
const int barHeight = (thickness + 1) * 2;
const int barHeight = UITheme::getProgressBarHeight(progressBar, thickness);
const int y = topEdge ? rect.y + previewInnerMargin : rect.y + rect.height - previewInnerMargin - barHeight;
const int barWidth = (rect.width - previewInnerMargin * 2) * percent / 100;
renderer.fillRect(rect.x + previewInnerMargin, y, barWidth, barHeight);
+2 -1
View File
@@ -7,6 +7,7 @@
#include <Logging.h>
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <string>
@@ -61,7 +62,7 @@ int progressBarPixelHeight(const uint8_t progressBar, const uint8_t thickness, c
int statusBarProgressPercent(const uint8_t progressBar, const float bookProgress, const int currentPage,
const int pageCount) {
if (progressBar == CrossPointSettings::STATUS_BAR_PROGRESS_BAR::BOOK_PROGRESS) {
return std::clamp(static_cast<int>(bookProgress), 0, 100);
return std::clamp(static_cast<int>(std::lround(bookProgress)), 0, 100);
}
const int chapterProgress =
(pageCount > 0) ? static_cast<int>((static_cast<float>(currentPage) / pageCount) * 100) : 0;