-
Notifications
You must be signed in to change notification settings - Fork 981
Description
Issue: (Describe the bug here)
The interactions do not work for WPF plots. I have tried it with the WPF demo sample and I cannot use any interaction (Open context menu, drag itp)
ScottPlot Version: 5.0.48
The version I used to debug the problem
Step 1. Edit ScottPlot5\ScottPlot5 Demos\ScottPlot5 WPF Demo\DemoWindows\Quickstart.xaml.cs
public Quickstart()
{
InitializeComponent();
WpfPlot1.Plot.Add.Signal(ScottPlot.Generate.Sin());
WpfPlot1.Plot.Add.Signal(ScottPlot.Generate.Cos());
WpfPlot1.UserInputProcessor.Reset();
WpfPlot1.Menu?.Reset();
WpfPlot1.Menu?.Add("Option", control => { });
WpfPlot1.UserInputProcessor.UserActionResponses.Clear();
WpfPlot1.UserInputProcessor.UserActionResponses.Add(
new SingleClickContextMenu(StandardMouseButtons.Right));
}When I attached the debugger I noticed that the SingleClickResponse.Execute method is exiting because Plot? plot = plotControl.GetPlotAtPixel(buttonAction.Pixel); is null

and the plot is null because the LastRenderRect for Multiplot.cs is NaN

The LastRenderRect is NaN because the only place where I have found LastRenderRect assignment is Render method

And there is only Render invocation in FormsPlot.cs, the WpfPlotBase does not call render function and it seams to be rendering plots in a different way.

I am unfamiliar with ScottPlot code base, so I don't know the correct solution for this problem. Should the Render method be also called for Wpf library?