개정판 d251456f
issue #214: adjust arrow size
Change-Id: I8aa507c61ea8a6dd72eb180f30d8493feed515ac
MarkupToPDF/Controls/Line/ArrowArcControl.cs | ||
---|---|---|
449 | 449 |
pathFigure.IsClosed = false; |
450 | 450 |
instanceGroup.Children.Add(pathGeometry); |
451 | 451 |
|
452 |
//화살표하나 |
|
453 |
instanceGroup.Children.Add(SingleAllow(this.MidPoint, this.StartPoint, this.LineSize)); |
|
454 |
//화살표 두개 |
|
455 |
instanceGroup.Children.Add(ConverseAllow(this.EndPoint, this.MidPoint, this.LineSize)); |
|
452 |
instanceGroup.Children.Add(DrawSet.DrawArrow(this.MidPoint, this.StartPoint, this.LineSize)); |
|
453 |
instanceGroup.Children.Add(DrawSet.DrawArrow(this.MidPoint, this.EndPoint, this.LineSize)); |
|
456 | 454 |
this.Base_ArcPath.Fill = this.StrokeColor; |
457 |
//Base_ArcPath.StrokeThickness = 3; |
|
458 | 455 |
|
459 | 456 |
instanceGroup.FillRule = FillRule.Nonzero; |
460 | 457 |
this.PathData = instanceGroup; |
461 | 458 |
this.OverViewPathData = PathData; |
462 | 459 |
|
463 | 460 |
} |
464 |
|
|
465 |
|
|
466 |
public static PathGeometry SingleAllow(Point p2, Point p1, double lineSize) |
|
467 |
{ |
|
468 |
double theta = Math.Atan2((p2.Y - p1.Y), (p2.X - p1.X)) * 180 / Math.PI; |
|
469 |
PathGeometry pathGeometry = new PathGeometry(); |
|
470 |
PathFigure pathFigure = new PathFigure(); |
|
471 |
pathFigure.StartPoint = p1; |
|
472 |
|
|
473 |
Point lpoint = new Point(p1.X + lineSize * 2, p1.Y + lineSize * 4); |
|
474 |
Point rpoint = new Point(p1.X - lineSize * 2, p1.Y + lineSize * 4); |
|
475 |
|
|
476 |
LineSegment seg1 = new LineSegment(); |
|
477 |
seg1.Point = lpoint; |
|
478 |
pathFigure.Segments.Add(seg1); |
|
479 |
|
|
480 |
LineSegment seg2 = new LineSegment(); |
|
481 |
seg2.Point = rpoint; |
|
482 |
pathFigure.Segments.Add(seg2); |
|
483 |
|
|
484 |
LineSegment seg3 = new LineSegment(); |
|
485 |
seg3.Point = p1; |
|
486 |
pathFigure.Segments.Add(seg3); |
|
487 |
|
|
488 |
pathFigure.IsClosed = true; |
|
489 |
pathFigure.IsFilled = true; |
|
490 |
|
|
491 |
pathGeometry.Figures.Add(pathFigure); |
|
492 |
pathGeometry.FillRule = FillRule.Nonzero; |
|
493 |
RotateTransform transform = new RotateTransform(); |
|
494 |
transform.Angle = theta - 90; |
|
495 |
transform.CenterX = p1.X; |
|
496 |
transform.CenterY = p1.Y; |
|
497 |
pathGeometry.Transform = transform; |
|
498 |
return pathGeometry; |
|
499 |
} |
|
500 |
|
|
501 |
public static PathGeometry ConverseAllow(Point p2, Point p1, double lineSize) |
|
502 |
{ |
|
503 |
double theta = Math.Atan2((p2.Y - p1.Y), (p2.X - p1.X)) * 180 / Math.PI; |
|
504 |
PathGeometry pathGeometry2 = new PathGeometry(); |
|
505 |
PathFigure pathFigure2 = new PathFigure(); |
|
506 |
pathFigure2.StartPoint = p2; |
|
507 |
|
|
508 |
Point lpoint2 = new Point(p2.X + lineSize * 2, p2.Y + lineSize * 4); |
|
509 |
Point rpoint2 = new Point(p2.X - lineSize * 2, p2.Y + lineSize * 4); |
|
510 |
LineSegment seg1_1 = new LineSegment(); |
|
511 |
seg1_1.Point = lpoint2; |
|
512 |
pathFigure2.Segments.Add(seg1_1); |
|
513 |
|
|
514 |
LineSegment seg2_1 = new LineSegment(); |
|
515 |
seg2_1.Point = rpoint2; |
|
516 |
pathFigure2.Segments.Add(seg2_1); |
|
517 |
|
|
518 |
LineSegment seg3_1 = new LineSegment(); |
|
519 |
seg3_1.Point = p2; |
|
520 |
pathFigure2.Segments.Add(seg3_1); |
|
521 |
|
|
522 |
LineSegment seg4_1 = new LineSegment(); |
|
523 |
|
|
524 |
seg4_1.Point = new Point(lpoint2.X, lpoint2.Y); |
|
525 |
pathFigure2.Segments.Add(seg4_1); |
|
526 |
|
|
527 |
//pathFigure2.IsFilled = true; |
|
528 |
//pathFigure2.IsClosed = true; |
|
529 |
|
|
530 |
RotateTransform transform2 = new RotateTransform(); |
|
531 |
transform2.Angle = theta + 90; |
|
532 |
transform2.CenterX = p2.X; |
|
533 |
transform2.CenterY = p2.Y; |
|
534 |
pathGeometry2.Figures.Add(pathFigure2); |
|
535 |
pathGeometry2.Transform = transform2; |
|
536 |
return pathGeometry2; |
|
537 |
} |
|
538 |
|
|
461 |
|
|
539 | 462 |
public void ApplyOverViewData() |
540 | 463 |
{ |
541 | 464 |
this.OverViewPathData = this.PathData; |
내보내기 Unified diff