Commit b076f3fe authored by Maciej Suminski's avatar Maciej Suminski

Fixed grid drawing when the grid origin has negative coordinates.

parent 84fa537b
......@@ -157,10 +157,10 @@ void GAL::DrawGrid()
assert( gridEndY >= gridStartY );
// Correct the index, else some lines are not correctly painted
gridStartX -= ( gridOrigin.x / gridSize.x ) + 1;
gridStartY -= ( gridOrigin.y / gridSize.y ) + 1;
gridEndX += ( gridOrigin.x / gridSize.x ) + 1;
gridEndY += ( gridOrigin.y / gridSize.y ) + 1;
gridStartX -= abs( gridOrigin.x / gridSize.x ) + 1;
gridStartY -= abs( gridOrigin.y / gridSize.y ) + 1;
gridEndX += abs( gridOrigin.x / gridSize.x ) + 1;
gridEndY += abs( gridOrigin.y / gridSize.y ) + 1;
// Draw the grid behind all other layers
SetLayerDepth( depthRange.y * 0.75 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment