개정판 6d1a8228
issue #923: optimize to draw control
Change-Id: I8dbeef611f15cabb8f742817161ef17823bc55d6
MarkupToPDF/Controls/Shape/TriControl.cs | ||
---|---|---|
322 | 322 |
|
323 | 323 |
this.SetTri(); |
324 | 324 |
} |
325 |
|
|
325 | 326 |
public void SetTri() |
326 | 327 |
{ |
327 | 328 |
this.ApplyTemplate(); |
... | ... | |
358 | 359 |
} |
359 | 360 |
pathFigure.StartPoint = this.StartPoint; |
360 | 361 |
|
361 |
LineSegment lineSegment0 = new LineSegment(); |
|
362 |
lineSegment0.Point = this.StartPoint; |
|
363 |
pathFigure.Segments.Add(lineSegment0); |
|
364 |
|
|
365 |
LineSegment lineSegment1 = new LineSegment(); |
|
366 |
|
|
367 |
if (MidPoint.X != 0 && MidPoint.Y != 0) |
|
368 |
{ |
|
369 |
lineSegment1.Point = this.MidPoint; |
|
370 |
pathFigure.Segments.Add(lineSegment1); |
|
371 |
} |
|
372 |
else |
|
373 |
{ |
|
374 |
lineSegment1.Point = this.EndPoint; |
|
375 |
pathFigure.Segments.Add(lineSegment1); |
|
376 |
} |
|
377 |
|
|
378 |
LineSegment lineSegment2 = new LineSegment(); |
|
379 |
lineSegment2.Point = this.EndPoint; |
|
380 |
pathFigure.Segments.Add(lineSegment2); |
|
381 |
|
|
362 |
List<Point> points = new List<Point>() { this.StartPoint }; |
|
363 |
if (MidPoint.X != 0 && MidPoint.Y != 0) points.Add(this.MidPoint); |
|
364 |
points.Add(this.EndPoint); |
|
382 | 365 |
|
366 |
PolyLineSegment polyline = new PolyLineSegment(points , true); |
|
367 |
pathFigure.Segments.Add(polyline); |
|
383 | 368 |
|
384 | 369 |
PathGeometry pathGeometry = new PathGeometry(); |
385 | 370 |
pathGeometry.Figures = new PathFigureCollection(); |
386 | 371 |
pathFigure.IsClosed = true; |
387 | 372 |
pathGeometry.Figures.Add(pathFigure); |
388 |
//this.FillColor = new SolidColorBrush(Colors.Red); |
|
389 |
//Base_TriPath.StrokeThickness = 3; |
|
390 |
//FillColor = Brushes.Red; |
|
391 | 373 |
|
392 | 374 |
this.PathData = pathGeometry; |
393 | 375 |
ApplyOverViewData(); |
내보내기 Unified diff