-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Labels
Good First IssueThis issue has limited complexity and may be a good start for new contributorsThis issue has limited complexity and may be a good start for new contributorsHelp WantedScott won't do this soon, but PRs from the community are welcome!Scott won't do this soon, but PRs from the community are welcome!
Description
I just merged #4328 to address #4319 but there's a rendering artifact due to the L shaped scalebar being drawn as two lines. Using a "path" with 3 points would fix this issue.
The issue can be seen in the cookbook recipe:
ScottPlot/src/ScottPlot5/ScottPlot5 Cookbook/Recipes/PlotTypes/ScaleBar.cs
Lines 68 to 70 in 800aae8
| var scalebar = myPlot.Add.ScaleBar(5, 0.25); | |
| scalebar.LineWidth = 5; | |
| scalebar.LineColor = Colors.Magenta; |
The fix may be implemented here by using DrawPath instead of DrawLine:
ScottPlot/src/ScottPlot5/ScottPlot5/Plottables/ScaleBar.cs
Lines 59 to 73 in 800aae8
| // TODO: use a path instead of two distinct lines to prevent artifacts at the corner | |
| if (Width > 0) | |
| { | |
| Drawing.DrawLine(rp.Canvas, paint, hLine, LineStyle); | |
| Pixel xCenter = new((hLine.X1 + hLine.X2) / 2, hLine.Y1 + LabelPadding.Top); | |
| XLabelStyle.Render(rp.Canvas, xCenter, paint, XLabel); | |
| } | |
| if (Height > 0) | |
| { | |
| Drawing.DrawLine(rp.Canvas, paint, vLine, LineStyle); | |
| Pixel yCenter = new(vLine.X1 + LabelPadding.Right, (vLine.Y1 + vLine.Y2) / 2); | |
| YLabelStyle.Render(rp.Canvas, yCenter, paint, YLabel); | |
| } |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Good First IssueThis issue has limited complexity and may be a good start for new contributorsThis issue has limited complexity and may be a good start for new contributorsHelp WantedScott won't do this soon, but PRs from the community are welcome!Scott won't do this soon, but PRs from the community are welcome!
