Добавлена корректировка координат, если при текущих объект "выходит" за границы
This commit is contained in:
parent
de539f3881
commit
ee1b280767
@ -83,6 +83,27 @@ public class DrawningDumpTrack
|
||||
|
||||
_pictureWidth = width;
|
||||
_pictureHeight = height;
|
||||
|
||||
if (_startPosX.HasValue || _startPosY.HasValue)
|
||||
{
|
||||
if (_drawningDumpTrackWidth + _startPosX > _pictureWidth)
|
||||
{
|
||||
_startPosX = _pictureWidth.Value - _drawningDumpTrackWidth;
|
||||
}
|
||||
else if (_startPosX < 0)
|
||||
{
|
||||
_startPosX = 0;
|
||||
}
|
||||
if (_drawningDumpTrackHeight + _startPosY > _pictureHeight)
|
||||
{
|
||||
_startPosY = _pictureHeight.Value - _drawningDumpTrackHeight;
|
||||
}
|
||||
else if (_startPosY < 0)
|
||||
{
|
||||
_startPosY = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user