Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ All notable changes to this project will be documented in this file.
- WindowsForms tracker no longer clipping outside PlotView boundaries (#1863)
- Histogram now rendering properly when using logarithmic Y axis (#740)
- Fix ExampleLibrary build errors in certain code pages (#1890)
- Fix for double.Epsilon zero check that fails on some architectures (#1924)

## [2.1.0] - 2021-10-02

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@ Scott W Harden <swharden@gmail.com>
Shankar Mathiah Nanjundan <shankar.ooty@hotmail.com>
Shun-ichi Goto <shunichi.goto@gmail.com>
Soarc <gor.rustamyan@gmail.com>
Soren Holstebroe <sh@pantoinspect.com>
Stefan Rado <oxyplot@sradonia.net>
stefan-schweiger
Steve Hoelzer <shoelzer@gmail.com>
Expand Down
10 changes: 5 additions & 5 deletions Source/OxyPlot/Axes/Axis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1449,7 +1449,7 @@ internal virtual void UpdateTransform(OxyRect bounds)
a1 -= this.MaximumDataMargin * marginSign;
}

if (this.ActualMaximum - this.ActualMinimum < double.Epsilon)
if (this.ActualMaximum - this.ActualMinimum <= double.Epsilon)
{
this.ActualMaximum = this.ActualMinimum + 1;
}
Expand Down Expand Up @@ -1740,7 +1740,7 @@ protected virtual double CalculateActualMaximum()
var actualMaximum = this.DataMaximum;
double range = this.DataMaximum - this.DataMinimum;

if (range < double.Epsilon)
if (range <= double.Epsilon)
{
double zeroRange = this.DataMaximum > 0 ? this.DataMaximum : 1;
actualMaximum += zeroRange * 0.5;
Expand Down Expand Up @@ -1769,7 +1769,7 @@ protected virtual double CalculateActualMinimum()
var actualMinimum = this.DataMinimum;
double range = this.DataMaximum - this.DataMinimum;

if (range < double.Epsilon)
if (range <= double.Epsilon)
{
double zeroRange = this.DataMaximum > 0 ? this.DataMaximum : 1;
actualMinimum -= zeroRange * 0.5;
Expand Down Expand Up @@ -1824,12 +1824,12 @@ protected double CalculateActualInterval(double availableSize, double maxInterva
return maxIntervalSize;
}

if (Math.Abs(maxIntervalSize) < double.Epsilon)
if (Math.Abs(maxIntervalSize) <= double.Epsilon)
{
throw new ArgumentException("Maximum interval size cannot be zero.", "maxIntervalSize");
}

if (Math.Abs(range) < double.Epsilon)
if (Math.Abs(range) <= double.Epsilon)
{
throw new ArgumentException("Range cannot be zero.", "range");
}
Expand Down
2 changes: 1 addition & 1 deletion Source/OxyPlot/Axes/LogarithmicAxis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public override void Pan(ScreenPoint ppt, ScreenPoint cpt)
var x0 = this.InverseTransform(isHorizontal ? ppt.X : ppt.Y);
var x1 = this.InverseTransform(isHorizontal ? cpt.X : cpt.Y);

if (Math.Abs(x1) < double.Epsilon)
if (Math.Abs(x1) <= double.Epsilon)
{
return;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/OxyPlot/Axes/MagnitudeAxis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ internal override void UpdateTransform(OxyRect bounds)
a1 -= this.MaximumDataMargin * marginSign;
}

if (this.ActualMaximum - this.ActualMinimum < double.Epsilon)
if (this.ActualMaximum - this.ActualMinimum <= double.Epsilon)
{
this.ActualMaximum = this.ActualMinimum + 1;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/OxyPlot/Axes/MagnitudeAxisFullPlotArea.cs
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ internal override void UpdateTransform(OxyRect bounds)
a1 -= this.MaximumDataMargin * marginSign;
}

if (this.ActualMaximum - this.ActualMinimum < double.Epsilon)
if (this.ActualMaximum - this.ActualMinimum <= double.Epsilon)
{
this.ActualMaximum = this.ActualMinimum + 1;
}
Expand Down
4 changes: 2 additions & 2 deletions Source/OxyPlot/Rendering/OxyPen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public static OxyPen Create(
LineStyle lineStyle = LineStyle.Solid,
LineJoin lineJoin = LineJoin.Miter)
{
if (color.IsInvisible() || lineStyle == LineStyle.None || Math.Abs(thickness) < double.Epsilon)
if (color.IsInvisible() || lineStyle == LineStyle.None || Math.Abs(thickness) <= double.Epsilon)
{
return null;
}
Expand All @@ -116,4 +116,4 @@ public override int GetHashCode()
}
}
}
}
}
4 changes: 2 additions & 2 deletions Source/OxyPlot/Series/PieSeries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ public override void Render(IRenderContext rc)
}

this.total = this.slices.Sum(slice => slice.Value);
if (Math.Abs(this.total) < double.Epsilon)
if (Math.Abs(this.total) <= double.Epsilon)
{
return;
}
Expand Down Expand Up @@ -490,4 +490,4 @@ protected internal override void UpdateMaxMin()
{
}
}
}
}
2 changes: 1 addition & 1 deletion Source/OxyPlot/Series/StairStepSeries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ public override TrackerHitResult GetNearestPoint(ScreenPoint point, bool interpo
u2 = 1;
}

if (Math.Abs(u2) < double.Epsilon)
if (Math.Abs(u2) <= double.Epsilon)
{
continue; // P1 && P2 coincident
}
Expand Down