PIBD-11 Shipilov N.S. Seaplane LabWork01 Simple LabWork1 #1
@ -35,8 +35,27 @@ public class DrawingSeaplane
|
||||
|
||||
public bool SetPictureSize(int width, int height)
|
||||
{
|
||||
_pictureHeight = height;
|
||||
if (_drawingSeaplaneWidth > width || _drawingSeaplaneHeight > height)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
_pictureWidth = width;
|
||||
_pictureHeight = height;
|
||||
|
||||
if (_startPosX.HasValue || _startPosY.HasValue)
|
||||
{
|
||||
|
||||
if (_startPosX + _drawingSeaplaneWidth > _pictureWidth)
|
||||
{
|
||||
_startPosX = _pictureWidth - _drawingSeaplaneWidth;
|
||||
}
|
||||
else if (_startPosX < 0) _startPosX = 0;
|
||||
if (_startPosY + _drawingSeaplaneHeight > _pictureHeight)
|
||||
{
|
||||
_startPosY = _pictureHeight - _drawingSeaplaneHeight;
|
||||
}
|
||||
else if (_startPosY < 0) _startPosY = 0;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -144,7 +163,7 @@ public class DrawingSeaplane
|
||||
new Point(_startPosX.Value + 190, _startPosY.Value + 20)
|
||||
};
|
||||
g.DrawPolygon(pen, pointsFaceBottom);
|
||||
|
||||
|
||||
Point[] pointsKeel = {
|
||||
new Point(_startPosX.Value + 10, _startPosY.Value - 30),
|
||||
new Point(_startPosX.Value + 10, _startPosY.Value + 5),
|
||||
|
Loading…
Reference in New Issue
Block a user