From 4f8db91ebf05dac17f8718b20aede85c8cfe830f Mon Sep 17 00:00:00 2001 From: d-buchmann Date: Fri, 16 Jul 2021 10:43:40 +0200 Subject: [PATCH 1/2] Skip assigning axes if the user already did --- .../OxyPlot/PlotController/Manipulators/MouseManipulator.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/OxyPlot/PlotController/Manipulators/MouseManipulator.cs b/Source/OxyPlot/PlotController/Manipulators/MouseManipulator.cs index db3627128..2d07f0f3a 100644 --- a/Source/OxyPlot/PlotController/Manipulators/MouseManipulator.cs +++ b/Source/OxyPlot/PlotController/Manipulators/MouseManipulator.cs @@ -34,9 +34,10 @@ protected MouseManipulator(IPlotView plotView) /// The instance containing the event data. public override void Started(OxyMouseEventArgs e) { - this.AssignAxes(e.Position); + if (this.XAxis == null || this.YAxis == null) + this.AssignAxes(e.Position); base.Started(e); this.StartPosition = e.Position; } } -} \ No newline at end of file +} From 97a5b4f0b034bb451a99cb54877442f700fe0e9e Mon Sep 17 00:00:00 2001 From: d-buchmann Date: Fri, 16 Jul 2021 10:48:20 +0200 Subject: [PATCH 2/2] Make PlotManipulator more flexible --- .../OxyPlot/PlotController/Manipulators/PlotManipulator.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/OxyPlot/PlotController/Manipulators/PlotManipulator.cs b/Source/OxyPlot/PlotController/Manipulators/PlotManipulator.cs index 5c22adaff..ac6dc062f 100644 --- a/Source/OxyPlot/PlotController/Manipulators/PlotManipulator.cs +++ b/Source/OxyPlot/PlotController/Manipulators/PlotManipulator.cs @@ -37,13 +37,13 @@ protected PlotManipulator(IPlotView view) /// Gets or sets the X axis. /// /// The X axis. - protected Axis XAxis { get; set; } + public Axis XAxis { get; set; } /// /// Gets or sets the Y axis. /// /// The Y axis. - protected Axis YAxis { get; set; } + public Axis YAxis { get; set; } /// /// Transforms a point from screen coordinates to data coordinates. @@ -88,4 +88,4 @@ protected void AssignAxes(ScreenPoint position) this.YAxis = yaxis; } } -} \ No newline at end of file +}