-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
In ScottPlot 4, I used Bracket plottable. I'm starting to use ScottPlot 5, but I haven't found this.
I added an ArrowShape to implement it in this way:
public class BracketLine : IArrowShape
{
public void Render(RenderPack rp, PixelLine arrowLine, ArrowStyle arrowStyle)
{
float length = arrowLine.Length;
PixelLine[] lines = [
new PixelLine(0, 0, 0, -arrowStyle.ArrowheadWidth / 4),
new PixelLine(0, 0, length, 0),
new PixelLine(length, 0, length, -arrowStyle.ArrowheadWidth / 4),
new PixelLine(length/2, 0, length/2, arrowStyle.ArrowheadWidth / 4)
];
rp.CanvasState.Save();
rp.CanvasState.Translate(arrowLine.Pixel2);
rp.CanvasState.RotateDegrees(arrowLine.AngleDegrees + 90);
// origin is the tip, base extends to the right
Drawing.DrawLines(rp.Canvas, rp.Paint, lines, arrowStyle.LineStyle);
rp.CanvasState.Restore();
}
}and I modified ArrowShape.cs adding BracketLine in enum and adding item in switch:
ArrowShape.BracketLine => new ArrowShapes.BracketLine(), The Cook book "Arrow Shapes" show it correctly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
