Keep the horizontal grid axis consistent
authorGed Murphy <gedmurphy@reactos.org>
Sat, 6 Jun 2009 13:08:22 +0000 (13:08 +0000)
committerGed Murphy <gedmurphy@reactos.org>
Sat, 6 Jun 2009 13:08:22 +0000 (13:08 +0000)
svn path=/trunk/; revision=41298

reactos/base/applications/taskmgr/graphctl.c

index baafa1c..e5ac540 100644 (file)
@@ -191,7 +191,7 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this, BOOL bResize)
     /*  to a bitmap.  The result is then BitBlt'd to the control whenever needed. */
     int i;
     int nCharacters;
-    int nTopGridPix, nMidGridPix, nBottomGridPix;
+    //int nTopGridPix, nMidGridPix, nBottomGridPix;
 
     HPEN oldPen;
     HPEN solidPen = CreatePen(PS_SOLID, 0, this->m_crGridColor);
@@ -250,19 +250,15 @@ void GraphCtrl_InvalidateCtrl(TGraphCtrl* this, BOOL bResize)
     LineTo(this->m_dcGrid, this->m_rectPlot.left, this->m_rectPlot.bottom+1);
     /*   LineTo(m_dcGrid, m_rectPlot.left, m_rectPlot.top); */
 
-    /*  draw the horizontal and vertical axis */
-    nMidGridPix    = (this->m_rectPlot.top + this->m_rectPlot.bottom)/2;
-    nTopGridPix    = nMidGridPix - this->m_nPlotHeight/4;
-    nBottomGridPix = nMidGridPix + this->m_nPlotHeight/4;
-
-    MoveToEx(this->m_dcGrid, this->m_rectPlot.left, nTopGridPix, NULL);
-    LineTo(this->m_dcGrid, this->m_rectPlot.right, nTopGridPix);
-    MoveToEx(this->m_dcGrid, this->m_rectPlot.left, nMidGridPix, NULL);
-    LineTo(this->m_dcGrid, this->m_rectPlot.right, nMidGridPix);
-    MoveToEx(this->m_dcGrid, this->m_rectPlot.left, nBottomGridPix, NULL);
-    LineTo(this->m_dcGrid, this->m_rectPlot.right, nBottomGridPix);
+    /*  draw the horizontal axis */
+    for (i = this->m_rectPlot.top; i < this->m_rectPlot.bottom; i += 12)
+    {
+        MoveToEx(this->m_dcGrid, this->m_rectPlot.left, this->m_rectPlot.top + i, NULL);
+        LineTo(this->m_dcGrid, this->m_rectPlot.right, this->m_rectPlot.top + i);
+    }
 
-    for (i = this->m_rectPlot.left; i<this->m_rectPlot.right; i+=13)
+    /*  draw the vertical axis */
+    for (i = this->m_rectPlot.left; i < this->m_rectPlot.right; i += 12)
     {
         MoveToEx(this->m_dcGrid, this->m_rectPlot.left + i, this->m_rectPlot.bottom, NULL);
         LineTo(this->m_dcGrid, this->m_rectPlot.left + i, this->m_rectPlot.top);