internal static void RemoveShape(Shape shape)
 {
     if (shape != null)
     {
         Canvas.Instance.layer.Remove(shape);
         ClickData.Action = ShapeClickAction.Delete;
         if (ClickData.IsShapesSingle() && ClickData.ContainsShapes(shape))
         {
             ClickData.ClearShapes();
         }
     }
     Canvas.Instance.Invalidate();
 }
Beispiel #2
0
        internal void Replace(Shape shape, Shape newShape)
        {
            // If the shape was selected, select replacement shape once created.
            bool wasShapeClicked = ClickData.ContainsShapes(shape);

            // Replace old shape with new shape
            var index = shapes.IndexOf(shape);

            shapes[index] = newShape;

            if (wasShapeClicked)
            {
                ClickData.Set(newShape);
            }
        }
Beispiel #3
0
 /// <summary>
 /// If ClickData's "Shapes" contains this shape, return true.
 /// </summary>
 public bool ShapeIsSelected()
 {
     return(ClickData.ContainsShapes(this));
 }