Reintroduce newlines via multiple text flags
All checks were successful
Build ptprnt / build (push) Successful in 3m31s

This commit is contained in:
2025-10-12 22:29:26 +02:00
parent 922ecdb57d
commit af2ba7de5b

View File

@@ -31,6 +31,10 @@ LabelBuilder::LabelBuilder(int printerHeight) : mPrinterHeight(printerHeight) {
ILabelBuilder& LabelBuilder::addText(const std::string& text) { ILabelBuilder& LabelBuilder::addText(const std::string& text) {
if (!text.empty()) { if (!text.empty()) {
if (!mAccumulatedText.empty()) {
// Add a newline if the label already has some text accumulated
mAccumulatedText += '\n';
}
mAccumulatedText += text; mAccumulatedText += text;
spdlog::debug("LabelBuilder: Added text '{}', total length: {}", text, mAccumulatedText.length()); spdlog::debug("LabelBuilder: Added text '{}', total length: {}", text, mAccumulatedText.length());
} }