ISEbd-22 Alimova M.S. Lab Work 03 #3

Closed
malimova wants to merge 12 commits from Lab3 into Lab2
Showing only changes of commit 52950b54cb - Show all commits

View File

@ -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);