From ab8db23d665b276caa28471bb4db37e6b0de44ef Mon Sep 17 00:00:00 2001 From: zautrix Date: Tue, 22 Mar 2005 16:21:03 +0000 Subject: fix --- (limited to 'korganizer/kodaymatrix.cpp') diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 366e8b8..59618bf 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -660,15 +660,15 @@ void KODayMatrix::dropEvent(QDropEvent *e) void KODayMatrix::paintEvent(QPaintEvent * pevent) { - QRect sz = frameRect(); - if ( sz.width() <= 0 || sz.height() <= 0 ) + + if ( width() <= 0 || height() <= 0 ) return; if ( mPendingUpdateBeforeRepaint ) { updateViewTimed(); mPendingUpdateBeforeRepaint = false; } - if ( myPix.width() != sz.width() || myPix.height()!=sz.height() ) { - myPix.resize(sz.size() ); + if ( myPix.width() != width() || myPix.height()!=height() ) { + myPix.resize(size() ); } QPainter p(&myPix); p.setFont(font()); @@ -679,16 +679,16 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) int row,col; int selw, selh; int xyOff = frameWidth(); - int colModulo = sz.width() % 7; - int rowModulo = sz.height() % 6; + int colModulo = (width()-2) % 7; + int rowModulo = (height()-2) % 6; //qDebug("col %d row %d ",colModulo,rowModulo ); bool isRTL = KOGlobals::self()->reverseLayout(); // draw background and topleft frame - p.fillRect(pevent->rect(), mDefaultBackColor); + p.fillRect(0,0,width(),height(), mDefaultBackColor); p.setPen(mDefaultTextColor); - p.drawRect(0, 0, sz.width()+1, sz.height()+1); + p.drawRect(0, 0, width(), height()); int mSelStartT = mSelStart; int mSelEndT = mSelEnd; if ( mSelEndT >= NUMDAYS ) @@ -763,7 +763,8 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) } if ( row == 0) addRow = 1; - p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, (7-col)*dwidth+colModulo, + int drawWid = width()-(col*dwidth+1+addCol2)-1; + p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, drawWid, dheight+1, selcol); // draw full block till last line selh = mSelEndT/7-row; @@ -914,7 +915,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) p.setFont(myFont); } } - int off = xyOff; + int off = 0;//xyOff; bitBlt (this, off, off, &myPix, 0 ,0,width(), height() ,CopyROP); //qDebug("ffffffffff %d ", off); } -- cgit v0.9.0.2