diff --git a/ElectricLocomotive/Generics/LocomotivesGenericCollection.cs b/ElectricLocomotive/Generics/LocomotivesGenericCollection.cs index 2b0644b..7e21c74 100644 --- a/ElectricLocomotive/Generics/LocomotivesGenericCollection.cs +++ b/ElectricLocomotive/Generics/LocomotivesGenericCollection.cs @@ -138,8 +138,9 @@ namespace ProjectElectricLocomotive.Generics continue; } - int widthCount = _pictureHeight / _placeSizeHeight; - drawningLocomotive.SetPosition((i / widthCount) * _placeSizeWidth, (i % widthCount) * _placeSizeHeight); + int ColumnCount = _pictureWidth / _placeSizeWidth; + int RowsCount = _pictureHeight / _placeSizeHeight; + drawningLocomotive.SetPosition((i % ColumnCount) * _placeSizeWidth, ((RowsCount - i / ColumnCount - 1) * _placeSizeHeight)); drawningLocomotive.DrawTransport(g); } }