From ba631577f2fc58f5c57377663dffa2fbaa6dee59 Mon Sep 17 00:00:00 2001 From: marusya Date: Wed, 15 Nov 2023 19:45:37 +0400 Subject: [PATCH] / --- .../SelfPropelledArtilleryUnit/DrawningUsta.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;