diff --git a/AccordionBus/AccordionBus/DrawningAccordionBus.cs b/AccordionBus/AccordionBus/DrawningAccordionBus.cs index 882b58f..5640a90 100644 --- a/AccordionBus/AccordionBus/DrawningAccordionBus.cs +++ b/AccordionBus/AccordionBus/DrawningAccordionBus.cs @@ -64,7 +64,7 @@ public class DrawningAccordionBus /// true - границы заданы, false - проверка не пройдена, нельзя public bool SetPictureSize(int width, int height) { - if (_drawningAccordionBusWidth < width && _drawningAccordionBusHeight < height) + if (_drawningAccordionBusWidth < width || _drawningAccordionBusHeight < height) { _pictureWidth = width; _pictureHeight = height; @@ -90,8 +90,8 @@ public class DrawningAccordionBus else { Random rnd = new Random(); - _startPosX = rnd.Next(0, _pictureWidth.Value - _drawningAccordionBusWidth); - _startPosY = rnd.Next(0, _pictureHeight.Value - _drawningAccordionBusHeight); + _startPosX = rnd.Next(0, 256); + _startPosY = rnd.Next(0, 256); } } public bool MoveTransport(DirectionType direction)