Fix chars sometimes overflowing a tiny little bit
authorManuel Nickschas <sputnick@quassel-irc.org>
Thu, 10 Jul 2008 23:35:47 +0000 (01:35 +0200)
committerManuel Nickschas <sputnick@quassel-irc.org>
Sat, 2 Aug 2008 13:17:10 +0000 (15:17 +0200)
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;