개정판 d2114d3b
issue #923: add OnMoveCtrlPoint method to interface
Change-Id: If3b10f5b54eaecd8bd8fa299d702e70e05d4b97e
MarkupToPDF/Controls/Polygon/PolygonControl.cs | ||
---|---|---|
503 | 503 |
} |
504 | 504 |
|
505 | 505 |
/// <summary> |
506 |
/// move control point has same location of given pt along given delta |
|
507 |
/// </summary> |
|
508 |
/// <author>humkyung</author> |
|
509 |
/// <date>2019.06.20</date> |
|
510 |
/// <param name="pt"></param> |
|
511 |
/// <param name="dx"></param> |
|
512 |
/// <param name="dy"></param> |
|
513 |
public override void OnMoveCtrlPoint(Point pt, double dx, double dy) |
|
514 |
{ |
|
515 |
Point selected = MathSet.getNearPoint((this as IPath).PointSet, pt); |
|
516 |
selected.X += dx; |
|
517 |
selected.Y += dy; |
|
518 |
for (int i = 0; i < (this as IPath).PointSet.Count; i++) |
|
519 |
{ |
|
520 |
if (pt.Equals((this as IPath).PointSet[i])) |
|
521 |
{ |
|
522 |
(this as IPath).PointSet[i] = selected; |
|
523 |
break; |
|
524 |
} |
|
525 |
} |
|
526 |
this.updateControl(); |
|
527 |
} |
|
528 |
|
|
529 |
/// <summary> |
|
506 | 530 |
/// return Polygon's area |
507 | 531 |
/// </summary> |
508 | 532 |
/// <author>humkyung</author> |
내보내기 Unified diff