This commit is contained in:
Вячеслав Иванов 2023-12-26 21:54:17 +04:00
parent 3aa54de00e
commit aa870dfeb3

View File

@ -66,12 +66,12 @@ public class TheBusesGenericCollection<T extends DrawningBus, U extends IMoveabl
private void DrawBackground(Graphics g) {
g.setColor(Color.BLACK);
for (int i = 0; i < _pictureWidth / _placeSizeWidth; i++) {
for (int j = 0; j < _pictureHeight / _placeSizeHeight + 1; ++j) {
g.drawLine(i * _placeSizeWidth, j * _placeSizeHeight,
i * _placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight);
for (int j = 0; j < _pictureHeight / (_placeSizeHeight * 2) + 1; ++j) {
g.drawLine(i * _placeSizeWidth, j * _placeSizeHeight * 2,
i * _placeSizeWidth + _placeSizeWidth / 2, j * _placeSizeHeight * 2);
}
g.drawLine(i * _placeSizeWidth, 0, i * _placeSizeWidth,
_pictureHeight / _placeSizeHeight * _placeSizeHeight);
_pictureHeight / (_placeSizeHeight * 2) * _placeSizeHeight * 2);
}
}
@ -80,7 +80,7 @@ public class TheBusesGenericCollection<T extends DrawningBus, U extends IMoveabl
DrawningBus bus = _collection.Get(i);
if (bus != null) {
int inRow = _pictureWidth / _placeSizeWidth;
bus.SetPosition((inRow - 1 - (i % inRow)) * _placeSizeWidth, i / inRow * _placeSizeHeight);
bus.SetPosition((inRow - 1 - (i % inRow)) * _placeSizeWidth, i / inRow * _placeSizeHeight * 2);
bus.DrawTransport((Graphics2D) g);
}
}