From 7880fc1215749760758f1524a23414e44a1fda93 Mon Sep 17 00:00:00 2001 From: bekodeg Date: Wed, 25 Oct 2023 09:06:28 +0400 Subject: [PATCH] =?UTF-8?q?=D0=B8=D1=81=D0=BF=D1=80=D0=B0=D0=B2=D0=BB?= =?UTF-8?q?=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BF=D0=BE=D1=80=D1=8F=D0=B4=D0=BA?= =?UTF-8?q?=D0=B0=20=D0=B4=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ElectricLocomotive/Generics/LocomotivesGenericCollection.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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); } }