diff --git a/common/gal/graphics_abstraction_layer.cpp b/common/gal/graphics_abstraction_layer.cpp index 821df4969f..00e976b19a 100644 --- a/common/gal/graphics_abstraction_layer.cpp +++ b/common/gal/graphics_abstraction_layer.cpp @@ -134,9 +134,6 @@ void GAL::DrawGrid() // Draw the grid // For the drawing the start points, end points and increments have // to be calculated in world coordinates - gridOffset = VECTOR2D( (long) gridOrigin.x % (long) gridSize.x, - (long) gridOrigin.y % (long) gridSize.y ); - VECTOR2D worldStartPoint = screenWorldMatrix * VECTOR2D( 0.0, 0.0 ); VECTOR2D worldEndPoint = screenWorldMatrix * VECTOR2D( screenSize ); diff --git a/include/gal/graphics_abstraction_layer.h b/include/gal/graphics_abstraction_layer.h index 24f207f355..f607e96975 100644 --- a/include/gal/graphics_abstraction_layer.h +++ b/include/gal/graphics_abstraction_layer.h @@ -631,6 +631,9 @@ public: inline void SetGridOrigin( const VECTOR2D& aGridOrigin ) { gridOrigin = aGridOrigin; + + gridOffset = VECTOR2D( (long) gridOrigin.x % (long) gridSize.x, + (long) gridOrigin.y % (long) gridSize.y ); } /** @@ -661,6 +664,9 @@ public: inline void SetGridSize( const VECTOR2D& aGridSize ) { gridSize = aGridSize; + + gridOffset = VECTOR2D( (long) gridOrigin.x % (long) gridSize.x, + (long) gridOrigin.y % (long) gridSize.y ); } /**