개정판 d2114d3b
issue #923: add OnMoveCtrlPoint method to interface
Change-Id: If3b10f5b54eaecd8bd8fa299d702e70e05d4b97e
MarkupToPDF/Controls/Shape/TriControl.cs | ||
---|---|---|
437 | 437 |
} |
438 | 438 |
|
439 | 439 |
/// <summary> |
440 |
/// move control point has same location of given pt along given delta |
|
441 |
/// </summary> |
|
442 |
/// <author>humkyung</author> |
|
443 |
/// <date>2019.06.20</date> |
|
444 |
/// <param name="pt"></param> |
|
445 |
/// <param name="delta"></param> |
|
446 |
public override void OnMoveCtrlPoint(Point pt, double dx, double dy) |
|
447 |
{ |
|
448 |
Point selected = MathSet.getNearPoint((this as IPath).PointSet, pt); |
|
449 |
selected.X += dx; |
|
450 |
selected.Y += dy; |
|
451 |
for (int i = 0; i < (this as IPath).PointSet.Count; i++) |
|
452 |
{ |
|
453 |
if (pt.Equals((this as IPath).PointSet[i])) |
|
454 |
{ |
|
455 |
(this as IPath).PointSet[i] = selected; |
|
456 |
} |
|
457 |
} |
|
458 |
this.updateControl(); |
|
459 |
} |
|
460 |
|
|
461 |
/// <summary> |
|
440 | 462 |
/// return tricontrols' area |
441 | 463 |
/// </summary> |
442 | 464 |
/// <author>humkyung</author> |
내보내기 Unified diff