public static void SwapShape(ICanvasContainer container, IBaseShape shape, int insertIndex, int removeIndex) { if (container != null && shape != null && insertIndex >= 0 && removeIndex >= 0) { container.Shapes.Insert(insertIndex, shape); container.Shapes.RemoveAt(removeIndex); container.MarkAsDirty(true); } }
public static void Swap(ICanvasContainer container, IBaseShape shape, int sourceIndex, int targetIndex) { if (sourceIndex < targetIndex) { SwapShape(container, shape, targetIndex + 1, sourceIndex); } else { if (container.Shapes.Count + 1 > sourceIndex + 1) { SwapShape(container, shape, targetIndex, sourceIndex + 1); } } }
public SkiaHitTest(ICanvasContainer container) { _renderer = new SkiaBoundsShapeRenderer(); _renderer._currentRootNode = -1; _renderer._rootNodes = new List <RootNode>(); var points = new List <IPointShape>(); container.GetPoints(points); foreach (var point in points) { _renderer._rootNodes.Add(new RootNode(point)); _renderer._currentRootNode++; point.Draw(null, _renderer, 0.0, 0.0, 1.0, null, null); } foreach (var shape in container.Shapes) { _renderer._rootNodes.Add(new RootNode(shape)); _renderer._currentRootNode++; shape.Draw(null, _renderer, 0.0, 0.0, 1.0, null, null); } }
public UiAttachSystem(ICanvasContainer canvasContainer, List <IAttachableUi> attachables) { _canvasContainer = canvasContainer; _attachables = attachables; }