fix: Only truncate labels using label-maxlen
This commit is contained in:
parent
8c8f677f7a
commit
ece172c759
1 changed files with 2 additions and 6 deletions
|
@ -213,12 +213,8 @@ void Builder::node(drawtypes::Label *label, bool add_space)
|
||||||
|
|
||||||
auto text = label->text;
|
auto text = label->text;
|
||||||
|
|
||||||
if (label->maxlen > 0) {
|
if (label->maxlen > 0 && text.length() > label->maxlen)
|
||||||
text.resize(label->maxlen);
|
text = text.substr(0, label->maxlen) + "...";
|
||||||
|
|
||||||
if (label->ellipsis && label->text.length() > label->maxlen)
|
|
||||||
text.append("...");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((label->ol.empty() && this->o > 0) || (this->o > 0 && label->margin > 0))
|
if ((label->ol.empty() && this->o > 0) || (this->o > 0 && label->margin > 0))
|
||||||
this->overline_close(true);
|
this->overline_close(true);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue