From 2f57565b9dbf8c6f359003bf23ca7b70d5829e22 Mon Sep 17 00:00:00 2001 From: Jonas Diemer Date: Sun, 1 Feb 2026 13:49:52 +0100 Subject: [PATCH] Round correctly and remove debug print. --- lib/Epub/Epub/ParsedText.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/Epub/Epub/ParsedText.cpp b/lib/Epub/Epub/ParsedText.cpp index 0bbc23b2..01f7aafc 100644 --- a/lib/Epub/Epub/ParsedText.cpp +++ b/lib/Epub/Epub/ParsedText.cpp @@ -68,8 +68,7 @@ void ParsedText::layoutAndExtractLines(const GfxRenderer& renderer, const int fo applyParagraphIndent(); const int pageWidth = viewportWidth; - const int spaceWidth = static_cast(wordSpacing) / 100.0 * renderer.getSpaceWidth(fontId); - Serial.printf("[%lu] [PaT] wordSpacing: %d spaceWidth: %d\n", millis(), wordSpacing, spaceWidth); + const int spaceWidth = std::round(static_cast(wordSpacing) / 100.0 * renderer.getSpaceWidth(fontId)); auto wordWidths = calculateWordWidths(renderer, fontId); std::vector lineBreakIndices; if (hyphenationEnabled) {