-rw-r--r-- | korganizer/koagendaitem.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 5ee433a..7e6fa48 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -472,2 +472,3 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) int xx = x(); + if ( xPaintCoord != xx || yPaintCoord != yy || @@ -499,3 +500,22 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) } - bitBlt (this, rx, ry, paintFrom, x()+rx ,yPaintCoord+ry, rw, rh ,CopyROP); + xx += rx; + + if ( xx < 0 ) { + rw = rw + xx; + rx -= xx; + xx = 0; + if ( rw < 0 ) { + qDebug("KOAgendaItem::Width1 < 0. Returning "); + return; + } + } + if ( paintFrom->width() < xx+rw ) { + rw = paintFrom->width() - xx; + if ( rw < 0 ) { + qDebug("KOAgendaItem::Width2 < 0. Returning "); + return; + } + } + //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); + bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); } |