From 52950b54cb108818f6e96ce95f6b871bf76c8272 Mon Sep 17 00:00:00 2001 From: malimova Date: Sun, 15 Oct 2023 23:57:12 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D0=BA=D0=B0=20=D0=BB=D0=BE=D0=B3=D0=B8=D0=BA=D0=B8=20DrawObjec?= =?UTF-8?q?ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AirBomber/AirBomber/PlanesGenericCollection.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/AirBomber/AirBomber/PlanesGenericCollection.cs b/AirBomber/AirBomber/PlanesGenericCollection.cs index 0031f45..0d996fb 100644 --- a/AirBomber/AirBomber/PlanesGenericCollection.cs +++ b/AirBomber/AirBomber/PlanesGenericCollection.cs @@ -119,15 +119,15 @@ namespace AirBomber private void DrawObjects(Graphics g) { int heightObjCount = _pictureHeight / _placeSizeHeight; - int widthObjCount = _pictureWidth / _placeSizeWidth; // Добавляем вычисление ширины + int widthObjCount = _pictureWidth / _placeSizeWidth; for (int i = 0; i < _collection.Count; i++) { T? type = _collection.Get(i); if (type != null) { - int row = i / widthObjCount; // Ряд - сначала сверху вниз - int col = widthObjCount - 1 - (i % widthObjCount); // Столбец - справа налево + int row = i / widthObjCount; + int col = widthObjCount - 1 - (i % widthObjCount); type.SetPosition(col * _placeSizeWidth, row * _placeSizeHeight); type?.DrawPlane(g);