public void CreateGroup(GroupShapes gr) { foreach (var shape in gr.Children) { DrawnShapes.Remove(shape); SelectedShapes.Remove(shape); } DrawnShapes.Add(gr); SelectedShapes.Add(gr); CreateMemento(); }
public void AddRemoveSelectedShape(int x, int y) { var shape = DrawnShapes.LastOrDefault(s => s.Contains(x, y)); if (shape == null) { SelectedShapes.Clear(); } else { if (!SelectedShapes.Contains(shape)) { SelectedShapes.Add(shape); } else { SelectedShapes.Remove(shape); } } _g.RefreshView(); }
private void ShapeSelectorHit(int index) { var shape = SymbolShapes[index]; if (IsSelectOneOrMoreShapeMode) { if (SelectedShapes.Contains(shape)) { SelectedShapes.Remove(shape); } else { SelectedShapes.Add(shape); } } else { SelectedShapes.Clear(); SelectedShapes.Add(shape); } GrtProperty(shape); PickerShape = null; if (SelectedShapes.Count > 0) { SetShapesAreSelected(); } else { SetIdleOnVoid(); } PickerShape = null; SetSizeSliders(); PickerCanvas.Invalidate(); EditorCanvas.Invalidate(); }