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) {
|
||||
if (!text.empty()) {
|
||||
if (!mAccumulatedText.empty()) {
|
||||
// Add a newline if the label already has some text accumulated
|
||||
mAccumulatedText += '\n';
|
||||
}
|
||||
mAccumulatedText += text;
|
||||
spdlog::debug("LabelBuilder: Added text '{}', total length: {}", text, mAccumulatedText.length());
|
||||
}
|
||||
@@ -81,9 +85,9 @@ std::unique_ptr<ILabel> LabelBuilder::build() {
|
||||
ILabelBuilder& LabelBuilder::reset() {
|
||||
mAccumulatedText.clear();
|
||||
mCurrentFontFamily = DEFAULT_FONT_FAMILY;
|
||||
mCurrentFontSize = DEFAULT_FONT_SIZE;
|
||||
mCurrentHAlign = HAlignPosition::LEFT;
|
||||
mCurrentVAlign = VAlignPosition::MIDDLE;
|
||||
mCurrentFontSize = DEFAULT_FONT_SIZE;
|
||||
mCurrentHAlign = HAlignPosition::LEFT;
|
||||
mCurrentVAlign = VAlignPosition::MIDDLE;
|
||||
spdlog::debug("LabelBuilder: Reset to default state");
|
||||
return *this;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user