-rw-r--r-- | korganizer/koagendaitem.cpp | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp index 9fe1be4..abb29f7 100644 --- a/korganizer/koagendaitem.cpp +++ b/korganizer/koagendaitem.cpp @@ -345,5 +345,5 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) if ( mSelected ) { - pa.begin( paintPixSel() ); + pa.begin( this ); } else { if ( mAllDay ) @@ -358,5 +358,8 @@ void KOAgendaItem::paintMe( bool selected, QPainter* paint ) yy = y(); else - yy = mCellYTop * ( height() / cellHeight() ); + yy = mCellYTop * ( height() / cellHeight() ); + if ( mSelected ) { + pa.translate( -x, -yy ); + } xPaintCoord= x; yPaintCoord = yy; @@ -471,5 +474,4 @@ void KOAgendaItem::resizePixmap( int w , int h ) { paintPix()->resize( w, h ); - paintPixSel()->resize( w, h ); } @@ -494,14 +496,5 @@ QPixmap * KOAgendaItem::paintPixAllday() return mPaintPixA ; } -QPixmap * KOAgendaItem::paintPixSel() -{ - static QPixmap* mPaintPixSel = 0; - if ( ! mPaintPixSel ) { - int w = QApplication::desktop()->width(); - int h = QApplication::desktop()->height(); - mPaintPixSel = new QPixmap(w,h); - } - return mPaintPixSel ; -} + void KOAgendaItem::paintEvent ( QPaintEvent *e ) { @@ -528,4 +521,6 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) //qDebug("calling paintMe "); globalFlagBlockAgendaItemUpdate = 1; + if ( mSelected ) + return; } int rx, ry, rw, rh; @@ -538,5 +533,6 @@ void KOAgendaItem::paintEvent ( QPaintEvent *e ) QPixmap* paintFrom ; if ( mSelected ) { - paintFrom = paintPixSel(); + paintMe( mSelected ); + return; } else { if ( mAllDay ) |