-
Notifications
You must be signed in to change notification settings - Fork 836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rendering problem - angled lines appear during mouse interaction #401
Comments
I have the same issue. |
This is so frustrating! This is an error in This issue may have re-emerged from recent work on the grid system a63eba9 I'll take a closer look!
This is because mouse interactions enable anti-aliasing mode |
This comment has been minimized.
This comment has been minimized.
small release that just addresses #401
This should be fixed in ScottPlot 4.0.33 now on NuGet. I'd appreciate your feedback to confirm it works on your machines! |
FWIW it's not just var plt = new ScottPlot.Plot(400, 300);
plt.Grid(xSpacing: 2, ySpacing: 2, color: Color.Red);
plt.Axis(-13, 13, -10, 10);
plt.GetSettings(false).misc.antiAliasData = false;
plt.GetSettings(false).misc.correctGridRenderingBug = false;
plt.SaveFig("microsoftPleaseExplain.png"); but enabling anti-aliasing fixes it 🙈 plt.GetSettings(false).misc.antiAliasData = true; |
SOLVED: Never create a solid Pen.DashPattern (set Pen.DashStyle to Solid instead)Assigning a dash pattern (even a solid one) automatically switches a pen's DashPattern from Solid to Custom. Custom dash patterns produce rendering artifacts when anti-aliasing is off. They're also less performant. I searched the code and removed all instances where the DashPattern was manually set. I created a helper function to safely make pens: |
Describe the bug
When the docked ScottPlot.FormsPlot is maximized together with the parent Form's window, strange angled lines appear at top right during middle mouse button pushed down. Same artifact happens when we use the right mouse button for zoom.
To Reproduce
VS Community 2019, Version 16.5.5.
ScottPlot 4.0.32 (previous version also has the same bug)
Steps to reproduce:
Create a new Winform project.
Drop a ScottPlot.FormsPlot user control into the Form, and set it as "Dock - Fill".
Run the project.
Maximize the Form window.
Start to use the mouse buttons for the different zoom options.
Bug appears visible.
Another info, if you set the grid line width to value 2 or higher (i did it in the Form's constructor), the bug seems to disappear:
formsPlot1.plt.Grid(lineWidth: 2);
Screenshots
I set the Grid color to red to make the bug more visible!
The text was updated successfully, but these errors were encountered: