Skip to content

Commit a285eec

Browse files
authored
No elided text for multiline text (#12983)
Fixes #12754
1 parent 33db447 commit a285eec

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

OMEdit/OMEditLIB/Annotations/TextAnnotation.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -434,11 +434,11 @@ void TextAnnotation::drawAnnotation(QPainter *painter)
434434
font.setPointSizeF(qMax(fontSizeFactor, Helper::minimumTextFontSize));
435435
painter->setFont(font);
436436
}
437-
/* Try to get the elided text if calculated font size <= Helper::minimumTextFontSize
438-
* OR if font size is absolute and text is not multiline.
437+
/* Try to get the elided text if calculated ((font size <= Helper::minimumTextFontSize OR if font size is absolute) AND text is not multiline).
438+
* Issue #8383 and #12754
439439
*/
440440
QString textToDraw = textString;
441-
if (mappedBoundingRect.width() > 1 && ((mFontSize <= 0 && painter->font().pointSizeF() <= Helper::minimumTextFontSize) || (mFontSize > 0 && !Utilities::isMultiline(textString)))) {
441+
if (mappedBoundingRect.width() > 1 && ((mFontSize <= 0 && painter->font().pointSizeF() <= Helper::minimumTextFontSize) || (mFontSize > 0)) && !Utilities::isMultiline(textString)) {
442442
QFontMetrics fontMetrics(painter->font());
443443
textToDraw = fontMetrics.elidedText(textString, Qt::ElideRight, mappedBoundingRect.width());
444444
// if we get "..." i.e., QChar(0x2026) as textToDraw then don't draw anything

0 commit comments

Comments
 (0)