author | zautrix <zautrix> | 2005-03-22 16:21:03 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-03-22 16:21:03 (UTC) |
commit | ab8db23d665b276caa28471bb4db37e6b0de44ef (patch) (side-by-side diff) | |
tree | 4697da2d9426f155237614368f993328560d0b21 /korganizer/kodaymatrix.cpp | |
parent | f36f0308a955f869f18c88ab359f9d605e838f1c (diff) | |
download | kdepimpi-ab8db23d665b276caa28471bb4db37e6b0de44ef.zip kdepimpi-ab8db23d665b276caa28471bb4db37e6b0de44ef.tar.gz kdepimpi-ab8db23d665b276caa28471bb4db37e6b0de44ef.tar.bz2 |
fix
-rw-r--r-- | korganizer/kodaymatrix.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp index 366e8b8..59618bf 100644 --- a/korganizer/kodaymatrix.cpp +++ b/korganizer/kodaymatrix.cpp @@ -661,6 +661,6 @@ 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 ) { @@ -668,6 +668,6 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) 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); @@ -680,6 +680,6 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) 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 ); @@ -687,7 +687,7 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) // 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; @@ -764,5 +764,6 @@ 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 @@ -915,5 +916,5 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent) } } - int off = xyOff; + int off = 0;//xyOff; bitBlt (this, off, off, &myPix, 0 ,0,width(), height() ,CopyROP); //qDebug("ffffffffff %d ", off); |