ISEbd-22 Alimova M.S. Lab Work 03 #3
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user