개정판 d251456f
issue #214: adjust arrow size
Change-Id: I8aa507c61ea8a6dd72eb180f30d8493feed515ac
MarkupToPDF/Controls/Line/ArcControl.cs | ||
---|---|---|
464 | 464 |
if (isTransOn) |
465 | 465 |
{ |
466 | 466 |
//isTransOn = true; |
467 |
instanceGroup.Children.Add(SingleAllow(this.MidPoint, this.StartPoint, this.LineSize));
|
|
468 |
instanceGroup.Children.Add(ConverseAllow(this.EndPoint, this.MidPoint, this.LineSize));
|
|
467 |
instanceGroup.Children.Add(DrawSet.DrawArrow(this.MidPoint, this.StartPoint, this.LineSize));
|
|
468 |
instanceGroup.Children.Add(DrawSet.DrawArrow(this.EndPoint, this.MidPoint, this.LineSize));
|
|
469 | 469 |
this.Base_ArcPath.Fill = this.StrokeColor; |
470 | 470 |
} |
471 | 471 |
//Base_ArcPath.StrokeThickness = 3; |
... | ... | |
476 | 476 |
|
477 | 477 |
} |
478 | 478 |
|
479 |
|
|
480 |
public static PathGeometry SingleAllow(Point p2, Point p1, double lineSize) |
|
481 |
{ |
|
482 |
double theta = Math.Atan2((p2.Y - p1.Y), (p2.X - p1.X)) * 180 / Math.PI; |
|
483 |
PathGeometry pathGeometry = new PathGeometry(); |
|
484 |
PathFigure pathFigure = new PathFigure(); |
|
485 |
pathFigure.StartPoint = p1; |
|
486 |
|
|
487 |
Point lpoint = new Point(p1.X + lineSize * 2, p1.Y + lineSize * 4); |
|
488 |
Point rpoint = new Point(p1.X - lineSize * 2, p1.Y + lineSize * 4); |
|
489 |
|
|
490 |
LineSegment seg1 = new LineSegment(); |
|
491 |
seg1.Point = lpoint; |
|
492 |
pathFigure.Segments.Add(seg1); |
|
493 |
|
|
494 |
LineSegment seg2 = new LineSegment(); |
|
495 |
seg2.Point = rpoint; |
|
496 |
pathFigure.Segments.Add(seg2); |
|
497 |
|
|
498 |
LineSegment seg3 = new LineSegment(); |
|
499 |
seg3.Point = p1; |
|
500 |
pathFigure.Segments.Add(seg3); |
|
501 |
|
|
502 |
pathFigure.IsClosed = true; |
|
503 |
pathFigure.IsFilled = true; |
|
504 |
|
|
505 |
pathGeometry.Figures.Add(pathFigure); |
|
506 |
pathGeometry.FillRule = FillRule.Nonzero; |
|
507 |
RotateTransform transform = new RotateTransform(); |
|
508 |
transform.Angle = theta - 90; |
|
509 |
transform.CenterX = p1.X; |
|
510 |
transform.CenterY = p1.Y; |
|
511 |
pathGeometry.Transform = transform; |
|
512 |
return pathGeometry; |
|
513 |
} |
|
514 |
|
|
515 | 479 |
public static PathGeometry ConverseAllow(Point p2, Point p1, double lineSize) |
516 | 480 |
{ |
517 | 481 |
double theta = Math.Atan2((p2.Y - p1.Y), (p2.X - p1.X)) * 180 / Math.PI; |
내보내기 Unified diff