private Shape DetectNewShapeDuringDrag(DragState state, MSet<LLShape> adorners, out bool potentialSelection)
{
potentialSelection = false;
Shape newShape = null;
adorners.Add(new LLPolyline(DiagramControl.MouseLineStyle, state.Points.Select(p => p.Point).AsList()) { ZOrder = 0x100 });
if (state.Points.Count == 1)
{
newShape = new Marker(Control.BoxStyle, state.FirstPoint, Control.MarkerRadius, Control.MarkerType);
}
else if (state.MousePoints.Count > 1)
{
#if DEBUG
List<Section> ss = BreakIntoSections(state);
EliminateTinySections(ss, 10 + (int)(ss.Sum(s => s.LengthPx) * 0.05));
foreach (Section s in ss)
adorners.Add(new LLMarker(new DrawStyle { LineColor = Color.Gainsboro, FillColor = Color.Gray }, s.StartSS, 5, MarkerPolygon.Circle));
#endif
newShape = RecognizeBoxOrLines(state, out potentialSelection);
}
return newShape;
}