-rw-r--r-- | korganizer/kodaymatrix.cpp | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 8affe50..c7e1b45 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -110,5 +110,8 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const QFrame(parent, name) #endif -{ +{ + oldW = 0; + oldH = 0; + myPix.resize( 150, 120 ); mRedrawNeeded = true; mKODaymatrixWhatsThis = new KODaymatrixWhatsThis(this); @@ -117,6 +120,6 @@ KODayMatrix::KODayMatrix(QWidget *parent, Calendar* calendar, QDate date, const // initialize dynamic arrays bDays.resize ( NUMDAYS ); - hDays.resize ( NUMDAYS );; - eDays.resize ( NUMDAYS );; + hDays.resize ( NUMDAYS ); + eDays.resize ( NUMDAYS ); days = new QDate[NUMDAYS]; daylbls = new QString[NUMDAYS]; @@ -335,5 +338,9 @@ void KODayMatrix::updateView() } void KODayMatrix::repaintViewTimed() -{ +{ + mRedrawNeeded = true; + bDays.fill( false); + hDays.fill( false); + eDays.fill( false); mRepaintTimer->stop(); repaint(false); @@ -684,9 +691,21 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) mPendingUpdateBeforeRepaint = false; } +#if 0 if ( myPix.width() != width() || myPix.height()!=height() ) { myPix.resize(size() ); mRedrawNeeded = true; } - +#endif + if ( oldW != width() || oldH !=height() ) + mRedrawNeeded = true; + + oldH = height() ; + oldW = width(); + if ( myPix.width() < width() || myPix.height() < height() ) { + myPix.resize(size() ); + mRedrawNeeded = true; + + } + if ( mRedrawNeeded ) { //qDebug("REDRAW "); @@ -948,5 +967,6 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) //qDebug("NO redraw "); } - bitBlt (this, 0, 0, &myPix, 0 ,0,width(), height() ,CopyROP); + + bitBlt (this, pevent->rect().topLeft(), &myPix , pevent->rect() ,CopyROP); mRedrawNeeded = false; } |