projects
/
quassel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Make sure that text lines aren't squeezed together in new Qt versions
[quassel.git]
/
src
/
qtui
/
chatitem.cpp
diff --git
a/src/qtui/chatitem.cpp
b/src/qtui/chatitem.cpp
index
b1a071b
..
c40fd34
100644
(file)
--- 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++;
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;
delete _data;
_data = 0;
@@
-443,6
+444,7
@@
void ContentsChatItem::doLayout(QTextLayout *layout) const {
if(!wrapList.count()) return; // empty chatitem
qreal h = 0;
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 {
WrapColumnFinder finder(this);
layout->beginLayout();
forever {
@@
-469,7
+471,7
@@
void ContentsChatItem::doLayout(QTextLayout *layout) const {
}
line.setPosition(QPointF(0, h));
}
line.setPosition(QPointF(0, h));
- h +=
fontMetrics()->lineSpacing()
;
+ h +=
spacing
;
}
layout->endLayout();
}
}
layout->endLayout();
}