X-Git-Url: https://git.quassel-irc.org/?p=quassel.git;a=blobdiff_plain;f=src%2Fqtui%2Fchatitem.cpp;h=c40fd34b96b687fba09b544763c9dbf4580a6226;hp=b1a071b8f864dedebe6fb04a831bd3434c5f560a;hb=5bc6dee39199868071a4926ae9859daa587537f7;hpb=b2de861297e7bb461b37ff041827c89360ecfec6 diff --git a/src/qtui/chatitem.cpp b/src/qtui/chatitem.cpp index b1a071b8..c40fd34b 100644 --- a/src/qtui/chatitem.cpp +++ b/src/qtui/chatitem.cpp @@ -426,7 +426,8 @@ qreal ContentsChatItem::setGeometryByWidth(qreal w) { WrapColumnFinder finder(this); while(finder.nextWrapColumn(w) > 0) lines++; - qreal h = lines * fontMetrics()->lineSpacing(); + qreal spacing = qMax(fontMetrics()->lineSpacing(), fontMetrics()->height()); // cope with negative leading() + qreal h = lines * spacing; delete _data; _data = 0; @@ -443,6 +444,7 @@ void ContentsChatItem::doLayout(QTextLayout *layout) const { if(!wrapList.count()) return; // empty chatitem qreal h = 0; + qreal spacing = qMax(fontMetrics()->lineSpacing(), fontMetrics()->height()); // cope with negative leading() WrapColumnFinder finder(this); layout->beginLayout(); forever { @@ -469,7 +471,7 @@ void ContentsChatItem::doLayout(QTextLayout *layout) const { } line.setPosition(QPointF(0, h)); - h += fontMetrics()->lineSpacing(); + h += spacing; } layout->endLayout(); }