From 62d3b3f4a46187770bad45b11dccea88de1d7541 Mon Sep 17 00:00:00 2001 From: Volker Fischer Date: Fri, 23 Oct 2009 14:58:14 +0000 Subject: [PATCH] server logging: fix for weekend grid in server history graph --- src/serverlogging.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/serverlogging.cpp b/src/serverlogging.cpp index b5820107..11db639a 100755 --- a/src/serverlogging.cpp +++ b/src/serverlogging.cpp @@ -36,7 +36,7 @@ CHistoryGraph::CHistoryGraph() : iYAxisEnd ( 24 ), iNumTicksY ( 5 ), iGridFrameOffset ( 10 ), - iGridWidthWeekend ( 4 ), // should be even + iGridWidthWeekend ( 3 ), // should be odd value iTextOffsetToGrid ( 3 ), iXAxisTextHeight ( 22 ), iMarkerSizeNewCon ( 11 ), @@ -134,7 +134,12 @@ void CHistoryGraph::DrawFrame ( const int iNewNumTicksX ) iBottomExtraTickLen = 5; } - // grid (different grid width for weekends) + // regular grid + PlotPainter.setPen ( PlotGridColor ); + PlotPainter.drawLine ( iCurX, 1 + PlotGridFrame.y(), + iCurX, PlotGridFrame.bottom() + iBottomExtraTickLen ); + + // different grid width for weekends (overwrite regular grid) if ( ( curXAxisDate.dayOfWeek() == 6 ) || ( curXAxisDate.dayOfWeek() == 7 ) ) { @@ -142,15 +147,7 @@ void CHistoryGraph::DrawFrame ( const int iNewNumTicksX ) PlotPainter.setPen ( QPen ( PlotGridColor, iGridWidthWeekend ) ); PlotPainter.drawLine ( iCurX, 1 + PlotGridFrame.y() + iGridWidthWeekendHalf, - iCurX, PlotGridFrame.bottom() - iGridWidthWeekendHalf + 1 + - iBottomExtraTickLen ); - } - else - { - // regular grid - PlotPainter.setPen ( PlotGridColor ); - PlotPainter.drawLine ( iCurX, 1 + PlotGridFrame.y(), - iCurX, PlotGridFrame.bottom() + iBottomExtraTickLen ); + iCurX, PlotGridFrame.bottom() - iGridWidthWeekendHalf ); } }