Refactored SetLastPointPosition method

This commit is contained in:
Wiesław Šoltés 2015-08-05 19:03:33 +02:00
Родитель c305d55144
Коммит df2f3591be
1 изменённых файлов: 1 добавлений и 9 удалений

Просмотреть файл

@ -242,14 +242,6 @@ namespace SpiroNet.Editor
shape.Points.Insert(index, point); shape.Points.Insert(index, point);
} }
private void SetLastPointPosition(double x, double y)
{
if (_shape == null || _shape.Points.Count < 1)
return;
SetPointPosition(_shape, _shape.Points.Count - 1, x, y);
}
private void SetPointPosition(PathShape shape, int index, double x, double y) private void SetPointPosition(PathShape shape, int index, double x, double y)
{ {
var point = new SpiroControlPoint(); var point = new SpiroControlPoint();
@ -500,7 +492,7 @@ namespace SpiroNet.Editor
{ {
if (_shape.Points.Count > 1) if (_shape.Points.Count > 1)
{ {
SetLastPointPosition(x, y); SetPointPosition(_shape, _shape.Points.Count - 1, x, y);
UpdateData(_shape); UpdateData(_shape);
Invalidate(); Invalidate();
} }