Fix ChatItem clipping (when selecting lines)
authorManuel Nickschas <sputnick@quassel-irc.org>
Fri, 7 Nov 2008 07:47:34 +0000 (08:47 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Fri, 7 Nov 2008 10:41:02 +0000 (11:41 +0100)
Yes, I remember again why I set a clipRect for the painter. And I still don't
know why the item doesn't clip automatically.

src/qtui/chatitem.cpp

index 679dc87..a78d2f8 100644 (file)
@@ -265,7 +265,7 @@ void ChatItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
 void SenderChatItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) {
   Q_UNUSED(option); Q_UNUSED(widget);
 
-  //painter->setClipRect(boundingRect()); // no idea why QGraphicsItem clipping won't work
+  painter->setClipRect(boundingRect()); // no idea why QGraphicsItem clipping won't work
   qreal layoutWidth = layout()->minimumWidth();
   qreal offset = 0;
   if(chatScene()->senderCutoffMode() == ChatScene::CutoffLeft)