private void ShowEraseDuringDrag(DragState state, MSet <LLShape> adorners, IEnumerable <Shape> eraseSet, List <PointT> simplified, bool cancel) { DiagramControl.EraseLineStyle.LineColor = Color.FromArgb(128, Control.BackColor); var eraseLine = new LLPolyline(DiagramControl.EraseLineStyle, simplified); adorners.Add(eraseLine); if (cancel) { eraseLine.Style = Control.LineStyle; Control.BeginRemoveAnimation(adorners); adorners.Clear(); state.IsComplete = true; } else { // Show which shapes are erased by drawing them in the background color foreach (Shape s in eraseSet) { Shape s_ = s.Clone(); s_.Style = (DiagramDrawStyle)s.Style.Clone(); s_.Style.FillColor = s_.Style.LineColor = s_.Style.TextColor = Color.FromArgb(192, Control.BackColor); // avoid an outline artifact, in which color from the edges of the // original shape bleeds through by a variable amount that depends // on subpixel offsets. s_.Style.LineWidth++; s_.AddLLShapesTo(adorners); } } }
private void ShowEraseDuringDrag(DragState state, MSet<LLShape> adorners, IEnumerable<Shape> eraseSet, List<PointT> simplified, bool cancel) { DiagramControl.EraseLineStyle.LineColor = Color.FromArgb(128, Control.BackColor); var eraseLine = new LLPolyline(DiagramControl.EraseLineStyle, simplified); adorners.Add(eraseLine); if (cancel) { eraseLine.Style = Control.LineStyle; Control.BeginRemoveAnimation(adorners); adorners.Clear(); state.IsComplete = true; } else { // Show which shapes are erased by drawing them in the background color foreach (Shape s in eraseSet) { Shape s_ = s.Clone(); s_.Style = (DiagramDrawStyle)s.Style.Clone(); s_.Style.FillColor = s_.Style.LineColor = s_.Style.TextColor = Color.FromArgb(192, Control.BackColor); // avoid an outline artifact, in which color from the edges of the // original shape bleeds through by a variable amount that depends // on subpixel offsets. s_.Style.LineWidth++; s_.AddLLShapesTo(adorners); } } }