Добавление проверки выхода за верхнюю и левую границы
This commit is contained in:
parent
070132467e
commit
42aa45de02
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user