minor fix 2
This commit is contained in:
parent
29891204b0
commit
051f96a96e
@ -39,6 +39,20 @@ namespace Catamaran
|
|||||||
{
|
{
|
||||||
_pictureWidth = width;
|
_pictureWidth = width;
|
||||||
_pictureHeight = height;
|
_pictureHeight = height;
|
||||||
|
if (_startPosX != null && _startPosY != null)
|
||||||
|
{
|
||||||
|
if (_startPosX.Value < 0) _startPosX = 0;
|
||||||
|
if (_startPosY.Value < 0) _startPosY = 0;
|
||||||
|
if (_startPosX.Value + _drawingCatamaranWidth > _pictureWidth)
|
||||||
|
{
|
||||||
|
_startPosX = _pictureWidth - _drawingCatamaranWidth;
|
||||||
|
}
|
||||||
|
if (_startPosY.Value + _drawingCatamaranHeight > _pictureHeight)
|
||||||
|
{
|
||||||
|
_startPosY = _pictureHeight - _drawingCatamaranHeight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
@ -67,26 +81,6 @@ namespace Catamaran
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void CheckPos()
|
|
||||||
{
|
|
||||||
//if ((!_startPosX.HasValue || !_startPosY.HasValue) && (!_pictureHeight.HasValue || !_pictureWidth.HasValue))
|
|
||||||
//{
|
|
||||||
// return;
|
|
||||||
//}
|
|
||||||
if (_startPosX == null || _startPosY == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (_startPosX.Value + _drawingCatamaranWidth > _pictureWidth)
|
|
||||||
{
|
|
||||||
_startPosX = _pictureWidth - _drawingCatamaranWidth;
|
|
||||||
}
|
|
||||||
if (_startPosY.Value + _drawingCatamaranHeight > _pictureHeight)
|
|
||||||
{
|
|
||||||
_startPosY = _pictureHeight - _drawingCatamaranHeight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool MoveTransport(DirectionType direction)
|
public bool MoveTransport(DirectionType direction)
|
||||||
{
|
{
|
||||||
if (EntityCatamaran == null || !_startPosX.HasValue || !_startPosY.HasValue)
|
if (EntityCatamaran == null || !_startPosX.HasValue || !_startPosY.HasValue)
|
||||||
|
@ -79,7 +79,6 @@ namespace Catamaran
|
|||||||
|
|
||||||
if (_drawingCatamaran.SetPictureSize(pictureBox1.Width, pictureBox1.Height))
|
if (_drawingCatamaran.SetPictureSize(pictureBox1.Width, pictureBox1.Height))
|
||||||
{
|
{
|
||||||
_drawingCatamaran.CheckPos();
|
|
||||||
Draw();
|
Draw();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user