Skip to content

Commit

Permalink
oxyplot#1029: Added check to LineAnnotation.GetScreenPoints() to chec…
Browse files Browse the repository at this point in the history
…k if ActualMaximumX==ActualMinimumX for non-curved lines.
  • Loading branch information
bryanfree66 authored and objorke committed Jun 17, 2017
1 parent a2ea9bc commit 5606558
Showing 1 changed file with 18 additions and 14 deletions.
32 changes: 18 additions & 14 deletions Source/OxyPlot/Annotations/LineAnnotation.cs
Expand Up @@ -92,23 +92,27 @@ protected override IList<ScreenPoint> GetScreenPoints()

if (!isCurvedLine)
{
// we only need to calculate two points if it is a straight line
if (fx != null)
{
points.Add(new DataPoint(this.ActualMinimumX, fx(this.ActualMinimumX)));
points.Add(new DataPoint(this.ActualMaximumX, fx(this.ActualMaximumX)));
}
else
if (this.ActualMinimumX != this.ActualMaximumX)
{
points.Add(new DataPoint(fy(this.ActualMinimumY), this.ActualMinimumY));
points.Add(new DataPoint(fy(this.ActualMaximumY), this.ActualMaximumY));
}
// we only need to calculate two points if it is a straight line
if (fx != null)
{
points.Add(new DataPoint(this.ActualMinimumX, fx(this.ActualMinimumX)));
points.Add(new DataPoint(this.ActualMaximumX, fx(this.ActualMaximumX)));
}
else
{
points.Add(new DataPoint(fy(this.ActualMinimumY), this.ActualMinimumY));
points.Add(new DataPoint(fy(this.ActualMaximumY), this.ActualMaximumY));
}

if (this.Type == LineAnnotationType.Horizontal || this.Type == LineAnnotationType.Vertical)
{
// use aliased line drawing for horizontal and vertical lines
this.Aliased = true;
if (this.Type == LineAnnotationType.Horizontal || this.Type == LineAnnotationType.Vertical)
{
// use aliased line drawing for horizontal and vertical lines
this.Aliased = true;
}
}

}
else
{
Expand Down

0 comments on commit 5606558

Please sign in to comment.