diff --git a/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/DrawningUsta.cs b/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/DrawningUsta.cs index 8095c73..8f5ecf9 100644 --- a/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/DrawningUsta.cs +++ b/SelfPropelledArtilleryUnit/SelfPropelledArtilleryUnit/DrawningUsta.cs @@ -95,7 +95,7 @@ namespace SelfPropelledArtilleryUnit.DrawningObjects public void SetPosition(int x, int y) { // TODO: Изменение x, y, если при установке объект выходит за границы - if (x < 0 || y < 0 ) + if (x < 0 || y < 0 || x + _ustaWidth > _pictureWidth || y + _ustaHeight > _pictureHeight) { x = 10; y = 10;