Reintroduce newlines via multiple text flags
All checks were successful
Build ptprnt / build (push) Successful in 3m31s
All checks were successful
Build ptprnt / build (push) Successful in 3m31s
This commit is contained in:
@@ -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());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user