From 4114801ea949317977509a117f1f79d7f1ddd9ce Mon Sep 17 00:00:00 2001 From: devil_1nc Date: Tue, 11 Oct 2022 16:45:46 +0400 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB(?= =?UTF-8?q?=D0=B0)=20=D0=BD=D0=B0=20'ProjectPlane/ProjectPlane/MapWithSetP?= =?UTF-8?q?lanesGeneric.cs'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ProjectPlane/MapWithSetPlanesGeneric.cs | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/ProjectPlane/ProjectPlane/MapWithSetPlanesGeneric.cs b/ProjectPlane/ProjectPlane/MapWithSetPlanesGeneric.cs index 122d40d..ddcf57b 100644 --- a/ProjectPlane/ProjectPlane/MapWithSetPlanesGeneric.cs +++ b/ProjectPlane/ProjectPlane/MapWithSetPlanesGeneric.cs @@ -69,6 +69,7 @@ namespace ProjectPlane { return map._setPlanes.Remove(position); } + /// /// Вывод всего набора объектов /// @@ -165,21 +166,26 @@ namespace ProjectPlane /// private void DrawPlanes(Graphics g) { - int width = _pictureWidth / _placeSizeWidth; + int width = _pictureWidth / _placeSizeWidth - 1; + int height = _pictureHeight / _placeSizeHeight - 1; - int curWidth = 0; - int curHeight = 0; for (int i = 0; i < _setPlanes.Count; i++) { - _setPlanes.Get(i)?.SetObject(curWidth * _placeSizeWidth + 10, curHeight * _placeSizeHeight + 15, _pictureWidth, _pictureHeight); + _setPlanes.Get(i)?.SetObject((width) * _placeSizeWidth + 10, (height) * _placeSizeHeight + 15, _pictureWidth, _pictureHeight); _setPlanes.Get(i)?.DrawingObject(g); + + if (width <= 0) + { + width = _pictureWidth / _placeSizeWidth - 1; + height--; + } + else + { + width--; + + } } - if (curWidth < width) curWidth++; - else - { - curWidth = 0; - curHeight++; - } + } } }