개정판 a5b465dc
issue #534: Add ItemRect property to all of controls
Change-Id: Id0d640b9fd9959615758b5e55b499f97d6f38dae
MarkupToPDF/Controls/Polygon/PolygonControl.cs | ||
---|---|---|
496 | 496 |
} |
497 | 497 |
|
498 | 498 |
/// <summary> |
499 |
/// return Polygon's area |
|
500 |
/// </summary> |
|
501 |
/// <author>humkyung</author> |
|
502 |
/// <date>2019.06.13</date> |
|
503 |
public override Rect ItemRect |
|
504 |
{ |
|
505 |
get |
|
506 |
{ |
|
507 |
double dMinX = double.MaxValue; |
|
508 |
double dMinY = double.MaxValue; |
|
509 |
double dMaxX = double.MinValue; |
|
510 |
double dMaxY = double.MinValue; |
|
511 |
foreach (Point pt in this.PointSet) |
|
512 |
{ |
|
513 |
dMinX = Math.Min(dMinX, pt.X); |
|
514 |
dMinY = Math.Min(dMinY, pt.Y); |
|
515 |
dMaxX = Math.Max(dMaxX, pt.X); |
|
516 |
dMaxY = Math.Max(dMaxY, pt.Y); |
|
517 |
} |
|
518 |
|
|
519 |
return new Rect(new Point(dMinX, dMinY), new Point(dMaxX, dMaxY)); |
|
520 |
} |
|
521 |
} |
|
522 |
|
|
523 |
/// <summary> |
|
499 | 524 |
/// Serialize this |
500 | 525 |
/// </summary> |
501 | 526 |
/// <param name="sUserId"></param> |
내보내기 Unified diff