Beispiel #1
0
 public void CreateGroup(GroupShapes gr)
 {
     foreach (var shape in gr.Children)
     {
         DrawnShapes.Remove(shape);
         SelectedShapes.Remove(shape);
     }
     DrawnShapes.Add(gr);
     SelectedShapes.Add(gr);
     CreateMemento();
 }
Beispiel #2
0
        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();
        }
Beispiel #3
0
        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();
        }