From 42aa45de0270a4eabc01302a62306fc07ad76dbc Mon Sep 17 00:00:00 2001 From: ivans Date: Tue, 12 Mar 2024 12:44:07 +0400 Subject: [PATCH] =?UTF-8?q?=D0=94=D0=BE=D0=B1=D0=B0=D0=B2=D0=BB=D0=B5?= =?UTF-8?q?=D0=BD=D0=B8=D0=B5=20=D0=BF=D1=80=D0=BE=D0=B2=D0=B5=D1=80=D0=BA?= =?UTF-8?q?=D0=B8=20=D0=B2=D1=8B=D1=85=D0=BE=D0=B4=D0=B0=20=D0=B7=D0=B0=20?= =?UTF-8?q?=D0=B2=D0=B5=D1=80=D1=85=D0=BD=D1=8E=D1=8E=20=D0=B8=20=D0=BB?= =?UTF-8?q?=D0=B5=D0=B2=D1=83=D1=8E=20=D0=B3=D1=80=D0=B0=D0=BD=D0=B8=D1=86?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ProjectMonorail/DrawingMonorail.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ProjectMonorail/DrawingMonorail.cs b/ProjectMonorail/DrawingMonorail.cs index 9f12a7a..f9f31a5 100644 --- a/ProjectMonorail/DrawingMonorail.cs +++ b/ProjectMonorail/DrawingMonorail.cs @@ -106,10 +106,18 @@ public class DrawingMonorail { return; } + if (x < 0) + { + x = 0; + } if (x + _drawingMonorailWidth > _pictureWidth.Value) { x = _pictureWidth.Value - _drawingMonorailWidth; } + if (y < 0) + { + y = 0; + } if (y + _drawingMonorailHeight > _pictureHeight.Value) { y = _pictureHeight.Value - _drawingMonorailHeight;