Fix chars sometimes overflowing a tiny little bit
[quassel.git] / src / qtui / chatitem.cpp
index b5fb62a..dfb069e 100644 (file)
@@ -91,8 +91,8 @@ int ChatItem::WrapColumnFinder::nextWrapColumn() {
           line.setLineWidth(item->width());
           layout->endLayout();
         }
-        int idx = line.xToCursor(lastwrappos + item->width());
-        qreal x = line.cursorToX(idx);
+        int idx = line.xToCursor(lastwrappos + item->width(), QTextLine::CursorOnCharacter);
+        qreal x = line.cursorToX(idx, QTextLine::Trailing);
         w = w - wrapList.at(wordidx).width - (x - lastwrappos);
         lastwrappos = x;
         lastwrapcol = idx;