diff --git a/AccordionBus/AccordionBus/DrawingAccordionBus.cs b/AccordionBus/AccordionBus/DrawingAccordionBus.cs
index ae52685..900b169 100644
--- a/AccordionBus/AccordionBus/DrawingAccordionBus.cs
+++ b/AccordionBus/AccordionBus/DrawingAccordionBus.cs
@@ -39,7 +39,7 @@ namespace AccordionBus
///
/// Ширина прорисовки автобуса
///
- private readonly int _busWidth = 200;
+ private int _busWidth = 100;
///
/// Высота прорисовки автобуса
@@ -61,6 +61,10 @@ namespace AccordionBus
_pictureWidth = width;
_pictureHeight = height;
EntityAccordionBus = new EntityAccordionBus();
+ if (additionalBody)
+ {
+ _busWidth = 215;
+ }
EntityAccordionBus.Init(speed, weight,
bodyColor, additionalColor,
additionalBody, additionalDoor);
@@ -119,13 +123,13 @@ namespace AccordionBus
}
break;
case DirectionType.Right:
- if (_startPosX + EntityAccordionBus.Step < _pictureWidth)
+ if (_startPosX + EntityAccordionBus.Step < _pictureWidth - _busWidth)
{
_startPosX += (int)EntityAccordionBus.Step;
}
break;
case DirectionType.Down:
- if (_startPosY + EntityAccordionBus.Step < _pictureHeight)
+ if (_startPosY + EntityAccordionBus.Step < _pictureHeight - _busHeight)
{
_startPosY += (int)EntityAccordionBus.Step;
}