From 2072741a59069f604a2eeeb6d913e5eca0e57716 Mon Sep 17 00:00:00 2001 From: Eunchurn Park Date: Sun, 4 Jan 2026 23:45:57 +0900 Subject: [PATCH] chore(clang-format-fix): fixing format --- lib/Txt/Txt.cpp | 8 +++++--- src/activities/reader/TxtReaderActivity.cpp | 14 +++++++++----- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lib/Txt/Txt.cpp b/lib/Txt/Txt.cpp index 3c8b37eb..52c75ed7 100644 --- a/lib/Txt/Txt.cpp +++ b/lib/Txt/Txt.cpp @@ -3,7 +3,8 @@ #include #include -Txt::Txt(std::string path, std::string cacheBasePath) : filepath(std::move(path)), cacheBasePath(std::move(cacheBasePath)) { +Txt::Txt(std::string path, std::string cacheBasePath) + : filepath(std::move(path)), cacheBasePath(std::move(cacheBasePath)) { // Generate cache path from file path hash const size_t hash = std::hash{}(filepath); cachePath = this->cacheBasePath + "/txt_" + std::to_string(hash); @@ -112,8 +113,9 @@ bool Txt::generateCoverBmp() const { // Get file extension const size_t len = coverImagePath.length(); - const bool isJpg = (len >= 4 && (coverImagePath.substr(len - 4) == ".jpg" || coverImagePath.substr(len - 4) == ".JPG")) || - (len >= 5 && (coverImagePath.substr(len - 5) == ".jpeg" || coverImagePath.substr(len - 5) == ".JPEG")); + const bool isJpg = + (len >= 4 && (coverImagePath.substr(len - 4) == ".jpg" || coverImagePath.substr(len - 4) == ".JPG")) || + (len >= 5 && (coverImagePath.substr(len - 5) == ".jpeg" || coverImagePath.substr(len - 5) == ".JPEG")); const bool isBmp = len >= 4 && (coverImagePath.substr(len - 4) == ".bmp" || coverImagePath.substr(len - 4) == ".BMP"); if (isBmp) { diff --git a/src/activities/reader/TxtReaderActivity.cpp b/src/activities/reader/TxtReaderActivity.cpp index a8b8b808..2208d5b4 100644 --- a/src/activities/reader/TxtReaderActivity.cpp +++ b/src/activities/reader/TxtReaderActivity.cpp @@ -141,7 +141,8 @@ void TxtReaderActivity::initializeReader() { // Calculate viewport dimensions int orientedMarginTop, orientedMarginRight, orientedMarginBottom, orientedMarginLeft; - renderer.getOrientedViewableTRBL(&orientedMarginTop, &orientedMarginRight, &orientedMarginBottom, &orientedMarginLeft); + renderer.getOrientedViewableTRBL(&orientedMarginTop, &orientedMarginRight, &orientedMarginBottom, + &orientedMarginLeft); orientedMarginTop += topPadding; orientedMarginLeft += horizontalPadding; orientedMarginRight += horizontalPadding; @@ -154,7 +155,8 @@ void TxtReaderActivity::initializeReader() { linesPerPage = viewportHeight / lineHeight; if (linesPerPage < 1) linesPerPage = 1; - Serial.printf("[%lu] [TRS] Viewport: %dx%d, lines per page: %d\n", millis(), viewportWidth, viewportHeight, linesPerPage); + Serial.printf("[%lu] [TRS] Viewport: %dx%d, lines per page: %d\n", millis(), viewportWidth, viewportHeight, + linesPerPage); // Try to load cached page index first if (!loadPageIndexCache()) { @@ -298,7 +300,8 @@ bool TxtReaderActivity::loadPageAtOffset(size_t offset, std::vector // Find break point size_t breakPos = line.length(); - while (breakPos > 0 && renderer.getTextWidth(SETTINGS.getReaderFontId(), line.substr(0, breakPos).c_str()) > viewportWidth) { + while (breakPos > 0 && + renderer.getTextWidth(SETTINGS.getReaderFontId(), line.substr(0, breakPos).c_str()) > viewportWidth) { // Try to break at space size_t spacePos = line.rfind(' ', breakPos - 1); if (spacePos != std::string::npos && spacePos > 0) { @@ -388,7 +391,8 @@ void TxtReaderActivity::renderScreen() { void TxtReaderActivity::renderPage() { int orientedMarginTop, orientedMarginRight, orientedMarginBottom, orientedMarginLeft; - renderer.getOrientedViewableTRBL(&orientedMarginTop, &orientedMarginRight, &orientedMarginBottom, &orientedMarginLeft); + renderer.getOrientedViewableTRBL(&orientedMarginTop, &orientedMarginRight, &orientedMarginBottom, + &orientedMarginLeft); orientedMarginTop += topPadding; orientedMarginLeft += horizontalPadding; orientedMarginRight += horizontalPadding; @@ -416,7 +420,7 @@ void TxtReaderActivity::renderPage() { } void TxtReaderActivity::renderStatusBar(const int orientedMarginRight, const int orientedMarginBottom, - const int orientedMarginLeft) const { + const int orientedMarginLeft) const { const bool showProgress = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL; const bool showBattery = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::NO_PROGRESS || SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL;