summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp48
1 files changed, 35 insertions, 13 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index 15a1cb4..507f18e 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -642,3 +642,3 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
642 int rowModulo = sz.height() % 6; 642 int rowModulo = sz.height() % 6;
643 qDebug("off %d col %d row %d ",xyOff,colModulo,rowModulo ); 643 //qDebug("off %d col %d row %d ",xyOff,colModulo,rowModulo );
644 644
@@ -682,3 +682,5 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
682 int addCol = 0; 682 int addCol = 0;
683 int addRow = 0; 683 int addRow = 0;
684 int addRow2 = 0;
685 int addCol2 = 0;
684#if 0 686#if 0
@@ -704,4 +706,11 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
704 if ( colModulo ) { 706 if ( colModulo ) {
705 if ( mSelEndT-mSelStartT+1 >= 7 - colModulo ) 707 int colt1 = mSelEndT%7;
706 addCol = mSelEndT-mSelStartT+1 - 7 + colModulo; 708 //qDebug("colt1 %d ", colt1 );
709 if ( colt1 >= 7 - colModulo )
710 addCol = colt1 - 7 + colModulo+1;
711 int colt = mSelStartT%7;
712 if ( colt >= 7 - colModulo )
713 addCol2 = colt - 7 + colModulo;
714 addCol -= addCol2;
715 //qDebug("COL %d %d %d %d ",col , colt1 ,addCol ,addCol2 );
707 } 716 }
@@ -710,3 +719,3 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
710 addRow = 1; 719 addRow = 1;
711 p.fillRect(isRTL ? (7 - (mSelEndT-mSelStartT+1) - col)*dwidth : col*dwidth+1, 720 p.fillRect(isRTL ? (7 - (mSelEndT-mSelStartT+1) - col)*dwidth : col*dwidth+1+addCol2,
712 row*dheight+addRow, (mSelEndT-mSelStartT+1)*dwidth+addCol, dheight+1, selcol); 721 row*dheight+addRow, (mSelEndT-mSelStartT+1)*dwidth+addCol, dheight+1, selcol);
@@ -714,10 +723,23 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
714 // draw first row to the right 723 // draw first row to the right
724 if ( colModulo ) {
725 if ( col >= 7 - colModulo )
726 addCol2 = col - 7 + colModulo;
727 }
728 if ( rowModulo ) {
729 if ( row >= 6 - rowModulo )
730 addRow = row - 5 + rowModulo;
731 }
715 if ( row == 0) 732 if ( row == 0)
716 addRow = 1; 733 addRow = 1;
717 p.fillRect(isRTL ? 0 : col*dwidth+1, row*dheight+addRow, (7-col)*dwidth+colModulo, 734 p.fillRect(isRTL ? 0 : col*dwidth+1+addCol2, row*dheight+addRow, (7-col)*dwidth+colModulo,
718 dheight, selcol); 735 dheight+1, selcol);
719 // draw full block till last line 736 // draw full block till last line
720 selh = mSelEndT/7-row; 737 selh = mSelEndT/7-row;
738 addRow = 0;
739 if ( rowModulo ) {
740 if ( mSelEndT/7 >= 6 - rowModulo )
741 addRow = mSelEndT/7 - 5 + rowModulo;
742 }
721 if (selh > 1) { 743 if (selh > 1) {
722 p.fillRect(1, (row+1)*dheight, 7*dwidth+colModulo, (selh-1)*dheight,selcol); 744 p.fillRect(1, (row+1)*dheight, 7*dwidth+colModulo, (selh-1)*dheight+addRow,selcol);
723 } 745 }
@@ -735,4 +757,4 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
735 //qDebug("add %d ", add); 757 //qDebug("add %d ", add);
736 p.fillRect(isRTL ? (7-selw)*dwidth : 1, (row+selh)*dheight, 758 p.fillRect(isRTL ? (7-selw)*dwidth : 1, (row+selh)*dheight+addRow,
737 selw*dwidth+add, dheight, selcol); 759 selw*dwidth+add, dheight+1, selcol);
738 } 760 }
@@ -829,3 +851,3 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
829 //qDebug("add %d %d -- %d %d ", col, addCol, row, addRow); 851 //qDebug("add %d %d -- %d %d ", col, addCol, row, addRow);
830 ++addCol;++addCol; 852 ++addCol;//++addCol;
831 p.drawText(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight, 853 p.drawText(col*dwidth+addCol, row*dheight+addRow, dwidth, dheight,