Commit b076f3fe authored by Maciej Suminski's avatar Maciej Suminski
Browse files

Fixed grid drawing when the grid origin has negative coordinates.

parent 84fa537b
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -157,10 +157,10 @@ void GAL::DrawGrid()
        assert( gridEndY >= gridStartY );
        assert( gridEndY >= gridStartY );


        // Correct the index, else some lines are not correctly painted
        // Correct the index, else some lines are not correctly painted
        gridStartX  -= ( gridOrigin.x / gridSize.x ) + 1;
        gridStartX -= abs( gridOrigin.x / gridSize.x ) + 1;
        gridStartY  -= ( gridOrigin.y / gridSize.y ) + 1;
        gridStartY -= abs( gridOrigin.y / gridSize.y ) + 1;
        gridEndX    += ( gridOrigin.x / gridSize.x ) + 1;
        gridEndX += abs( gridOrigin.x / gridSize.x ) + 1;
        gridEndY    += ( gridOrigin.y / gridSize.y ) + 1;
        gridEndY += abs( gridOrigin.y / gridSize.y ) + 1;


        // Draw the grid behind all other layers
        // Draw the grid behind all other layers
        SetLayerDepth( depthRange.y * 0.75 );
        SetLayerDepth( depthRange.y * 0.75 );