@@ -8,6 +8,7 @@
|
|||||||
#include <Utf8.h>
|
#include <Utf8.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <functional>
|
||||||
#include <numeric>
|
#include <numeric>
|
||||||
|
|
||||||
#include "CrossPointSettings.h"
|
#include "CrossPointSettings.h"
|
||||||
@@ -657,15 +658,13 @@ void MdReaderActivity::render(RenderLock&&) {
|
|||||||
void MdReaderActivity::renderPage() {
|
void MdReaderActivity::renderPage() {
|
||||||
const int lineHeight = renderer.getLineHeight(cachedFontId);
|
const int lineHeight = renderer.getLineHeight(cachedFontId);
|
||||||
|
|
||||||
auto renderLines =
|
std::function<void()> renderLines = [&]() {
|
||||||
[&]() {
|
|
||||||
int y = cachedOrientedMarginTop;
|
int y = cachedOrientedMarginTop;
|
||||||
for (const auto& line : currentPageLines) {
|
for (const auto& line : currentPageLines) {
|
||||||
if (line.isHR) {
|
if (line.isHR) {
|
||||||
// Draw horizontal rule as a thin line
|
// Draw horizontal rule as a thin line
|
||||||
int hrY = y + lineHeight / 2;
|
int hrY = y + lineHeight / 2;
|
||||||
renderer.drawLine(cachedOrientedMarginLeft + line.indent, hrY, cachedOrientedMarginLeft + viewportWidth,
|
renderer.drawLine(cachedOrientedMarginLeft + line.indent, hrY, cachedOrientedMarginLeft + viewportWidth, hrY);
|
||||||
hrY);
|
|
||||||
} else {
|
} else {
|
||||||
if (line.isCodeBlock) {
|
if (line.isCodeBlock) {
|
||||||
const int barX = cachedOrientedMarginLeft + std::max(line.indent - 6, 0);
|
const int barX = cachedOrientedMarginLeft + std::max(line.indent - 6, 0);
|
||||||
@@ -701,6 +700,7 @@ void MdReaderActivity::renderPage() {
|
|||||||
}
|
}
|
||||||
y += lineHeight;
|
y += lineHeight;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
// Font prewarm: scan pass accumulates text, then prewarm, then real render
|
// Font prewarm: scan pass accumulates text, then prewarm, then real render
|
||||||
@@ -716,12 +716,11 @@ void MdReaderActivity::renderPage() {
|
|||||||
ReaderUtils::displayWithRefreshCycle(renderer, pagesUntilFullRefresh);
|
ReaderUtils::displayWithRefreshCycle(renderer, pagesUntilFullRefresh);
|
||||||
|
|
||||||
if (SETTINGS.textAntiAliasing) {
|
if (SETTINGS.textAntiAliasing) {
|
||||||
ReaderUtils::renderAntiAliased(renderer, [&renderLines]() { renderLines(); });
|
ReaderUtils::renderAntiAliased(renderer, [&]() { renderLines(); });
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void MdReaderActivity::renderStatusBar() const {
|
||||||
MdReaderActivity::renderStatusBar() const {
|
|
||||||
const float progress = totalPages > 0 ? (currentPage + 1) * 100.0f / totalPages : 0;
|
const float progress = totalPages > 0 ? (currentPage + 1) * 100.0f / totalPages : 0;
|
||||||
std::string title;
|
std::string title;
|
||||||
if (SETTINGS.statusBarTitle != CrossPointSettings::STATUS_BAR_TITLE::HIDE_TITLE) {
|
if (SETTINGS.statusBarTitle != CrossPointSettings::STATUS_BAR_TITLE::HIDE_TITLE) {
|
||||||
|
|||||||
Reference in New Issue
Block a user