-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Issue:
The CoordinateRect.Contains class does not act logically for CoordinateRects where IsInvertedX or IsInvertedY returns true.
ScottPlot Version:
5.0.47
Code Sample:
using System.Diagnostics;
namespace ScottPlotInvertedCoordinateRect
{
internal class Program
{
static void Main(string[] args)
{
double value = 5;
ScottPlot.Plot myPlot = new();
ScottPlot.Bar myNegativeBar = new() { Value = -value };
ScottPlot.Bar myPositiveBar = new() { Value = value };
myPlot.Add.Bars(new[] { myNegativeBar, myPositiveBar });
myPlot.SavePng("repro.png", 400, 300);
myPlot.ZoomRectangle.VerticalSpan = true;
// Should not assert
Debug.Assert(myPositiveBar.Rect.Contains(0, value / 2),
$"Rect {myPositiveBar.Rect} should contain the point (0, {value/2})");
// Should not assert, but does
Debug.Assert(myNegativeBar.Rect.Contains(0, -value / 2),
$"Rect {myNegativeBar.Rect} should contain the point (0, {-value / 2})");
}
}
}Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels