summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/kodaymatrix.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index f864022..ae0a051 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -442,10 +442,20 @@ QString KODayMatrix::getHolidayLabel(int offset)
}
int KODayMatrix::getDayIndexFrom(int x, int y)
{
+ int colModulo = (width()-2) % 7;
+ int rowModulo = (height()-2) % 6;
+#if 0
return 7*(y/daysize.height()) + (KOGlobals::self()->reverseLayout() ?
6 - x/daysize.width() : x/daysize.width());
+#endif
+ int xVal = (x-colModulo/2-2)/daysize.width();
+ int yVal = (y-rowModulo/2-2)/daysize.height();
+
+
+ return 7*(yVal) + xVal;
+
}
// ----------------------------------------------------------------------------
// M O U S E E V E N T H A N D L I N G
@@ -641,9 +651,9 @@ void KODayMatrix::paintEvent(QPaintEvent * pevent)
int selw, selh;
int xyOff = frameWidth();
int colModulo = sz.width() % 7;
int rowModulo = sz.height() % 6;
- qDebug("col %d row %d ",colModulo,rowModulo );
+ //qDebug("col %d row %d ",colModulo,rowModulo );
bool isRTL = KOGlobals::self()->reverseLayout();
// draw background and topleft frame