-
Notifications
You must be signed in to change notification settings - Fork 981
Closed
Description
Recent snapping functionality was added using Func<T, T> (#2007) but it would be nice to have a collection of possible snap logic (e.g., snap to an array of predefined numbers) but that's hard because these functions accept and return a single value.
ScottPlot/src/ScottPlot4/ScottPlot/Plottable/AxisLine.cs
Lines 117 to 120 in 2e3c606
| /// <summary> | |
| /// This function applies snapping logic while dragging | |
| /// </summary> | |
| public Func<double, double> DragSnapX { get; set; } = (x) => x; |
I'd like to be able to do something like this:
double[] mySnapPoints = { 1, 2, 3 };
ISnap snapper = new ScottPlot.SnapLogic.Nearest(mySnapPoints);
vline1.DragSnapX = snapper;I'm thinking something like:
public interface ISnap
{
double Snap(double value);
}suggested by @Agorath in https://scottplot.net/discord/
related:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels