Fix off-by-one bug in a line that was even more buggy until a few hours ago.
authorManuel Nickschas <sputnick@quassel-irc.org>
Mon, 25 Jun 2007 20:31:21 +0000 (20:31 +0000)
committerManuel Nickschas <sputnick@quassel-irc.org>
Mon, 25 Jun 2007 20:31:21 +0000 (20:31 +0000)
src/qtgui/chatline.cpp
src/qtgui/chatwidget.cpp

index fd3c710..5d0a973 100644 (file)
@@ -223,7 +223,6 @@ int ChatLine::posToCursor(QPointF pos) {
       return line.start;
     }
   }
       return line.start;
     }
   }
-  qWarning() << "Should we ever reach this point?";
   return 0;
 }
 
   return 0;
 }
 
index ea6adf0..a437a0d 100644 (file)
@@ -281,7 +281,7 @@ void ChatWidget::layout() {
 }
 
 int ChatWidget::yToLineIdx(qreal y) {
 }
 
 int ChatWidget::yToLineIdx(qreal y) {
-  if(y >= ycoords[ycoords.count()-1]) return ycoords.count()-1;
+  if(y >= ycoords[ycoords.count()-1]) return ycoords.count()-2;
   if(ycoords.count() <= 1) return 0;
   int uidx = 0;
   int oidx = ycoords.count() - 1;
   if(ycoords.count() <= 1) return 0;
   int uidx = 0;
   int oidx = ycoords.count() - 1;