개정판 d251456f
issue #214: adjust arrow size
Change-Id: I8aa507c61ea8a6dd72eb180f30d8493feed515ac
MarkupToPDF/Controls/Line/ArrowControl_Multi.cs | ||
---|---|---|
262 | 262 |
if (this.MiddlePoint == new Point(0,0)) |
263 | 263 |
{ |
264 | 264 |
//instanceGroup.Children.Add(SingleAllow(this.StartPoint, this.MiddlePoint, this.LineSize)); |
265 |
instanceGroup.Children.Add(SingleAllow(this.StartPoint, this.EndPoint, this.LineSize));
|
|
265 |
instanceGroup.Children.Add(DrawSet.DrawArrow(this.StartPoint, this.EndPoint, this.LineSize));
|
|
266 | 266 |
} |
267 | 267 |
else |
268 | 268 |
{ |
269 |
instanceGroup.Children.Add(SingleAllow(this.MiddlePoint, this.EndPoint, this.LineSize));
|
|
269 |
instanceGroup.Children.Add(DrawSet.DrawArrow(this.MiddlePoint, this.EndPoint, this.LineSize));
|
|
270 | 270 |
LineSegment lineSegment1 = new LineSegment(); |
271 | 271 |
lineSegment1.Point = this.MiddlePoint; |
272 | 272 |
pathFigure.Segments.Add(lineSegment1); |
... | ... | |
335 | 335 |
// return pathGeometry; |
336 | 336 |
//} |
337 | 337 |
|
338 |
public static PathGeometry SingleAllow(Point p2, Point p1, double lineSize) |
|
339 |
{ |
|
340 |
double theta = Math.Atan2((p2.Y - p1.Y), (p2.X - p1.X)) * 180 / Math.PI; |
|
341 |
PathGeometry pathGeometry = new PathGeometry(); |
|
342 |
PathFigure pathFigure = new PathFigure(); |
|
343 |
pathFigure.StartPoint = p1; |
|
344 |
//lineSize = 2; |
|
345 |
Point lpoint = new Point(p1.X + lineSize * 3, p1.Y + lineSize * 6); |
|
346 |
Point rpoint = new Point(p1.X - lineSize * 3, p1.Y + lineSize * 6); |
|
347 |
|
|
348 |
LineSegment seg1 = new LineSegment(); |
|
349 |
seg1.Point = lpoint; |
|
350 |
pathFigure.Segments.Add(seg1); |
|
351 |
|
|
352 |
LineSegment seg2 = new LineSegment(); |
|
353 |
seg2.Point = rpoint; |
|
354 |
pathFigure.Segments.Add(seg2); |
|
355 |
|
|
356 |
LineSegment seg3 = new LineSegment(); |
|
357 |
seg3.Point = p1; |
|
358 |
pathFigure.Segments.Add(seg3); |
|
359 |
|
|
360 |
pathFigure.IsClosed = true; |
|
361 |
pathFigure.IsFilled = true; |
|
362 |
|
|
363 |
pathGeometry.Figures.Add(pathFigure); |
|
364 |
pathGeometry.FillRule = FillRule.Nonzero; |
|
365 |
RotateTransform transform = new RotateTransform(); |
|
366 |
transform.Angle = theta - 90; |
|
367 |
transform.CenterX = p1.X; |
|
368 |
transform.CenterY = p1.Y; |
|
369 |
pathGeometry.Transform = transform; |
|
370 |
return pathGeometry; |
|
371 |
} |
|
372 | 338 |
protected void OnPropertyChanged(string propName) |
373 | 339 |
{ |
374 | 340 |
if (PropertyChanged != null) |
내보내기 Unified diff