WPF Plot Stops Refreshing Until Mouse Panning Stops
See original GitHub issueBug Report
Issue: After a brief time of continuous mouse panning (a second or so) the plot stops refreshing until the mouse stops moving.
Reproducing: Click and drag pan constantly (do not let the mouse stop), at first everything refreshes and works but then it stops refreshing and as long as the mouse is kept moving it never redraws, once the mouse stops (even with mouse button not released) it refreshes but has the problem again if panning starts again. The bug is consistently reproducible with a debugger attached to essentially an empty example (see code, axes stop refreshing), or when using the exact same example code in a larger application (without debugger attached). I am not sure why it doesn’t happen in all cases. I have investigated and tried toggling/changing all of the configuration quality options (under WpfPlot.Configuration.Quality
and WpfPlot.Configuration.QualityConfiguration
) but nothing seems to fix the issue.
This issue is also always reproducible when running the WPF ScottPlot Demo or sandbox/WpfApp in the repository with debugger attached (but does not have the problem when running without debugger). This issue does not seem to be reproducible in WinForms with debugger attached.
I don’t mind the problem being present with a debugger attached, but I have the problem without a debugger attached when using ScottPlot.WPF in a larger application.
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
WpfPlot.Plot.Clear();
WpfPlot.Refresh();
}
}
<Window x:Class="GeometryScene.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
Title="MainWindow" Height="450" Width="800">
<Grid x:Name="MainGrid">
<WpfPlot x:Name="WpfPlot"></WpfPlot>
</Grid>
</Window>
System Details
- ScottPlot Version: 4.1.26
- Operating System: Windows 10
- Application Type: WPF
- .NET Version: NET Framework 4.7.1 or NET Framework 4.8.1
Issue Analytics
- State:
- Created 2 years ago
- Comments:13 (9 by maintainers)
Top GitHub Comments
I am currently busy to switch from nuget to source code, but whenever possible(might be in couple of hours) I will try and post the result here
@riquich this issue was closed because I just merged #1388 but I wanted to follow-up on this…
Hi @riquich, thanks for calling this out! I’m surprised to learn you’re experiencing unexpected behavior because I intended #1364 to have no change in default behavior. That PR has been merged to the main branch and I was planning to push it to NuGet tonight, but your comment makes me want to double-check what may be going on here.
The latest source code in the main branch has a DPI scaling demo at the bottom of the demo application (WPF demo, not the WinForms demo). Is the default behavior still surprising to you, and/or can you meet your program’s goals by setting the
DpiStretch
configuration option?If your answer is advanced it may be worth discussing further on #1364 instead of here 👍