public PathShape Op(IToolContext context, PathOp op, ICollection <IBaseShape> selected) { var path = default(PathShape); var shapes = GetShapes(selected); if (shapes != null && shapes.Count > 0) { var paths = ToPaths(context, shapes); if (paths != null && paths.Count > 0) { var result = SkiaHelper.Op(SkiaHelper.ToSKPathOp(op), paths); if (result != null) { if (!result.IsEmpty) { var style = context.DocumentContainer?.StyleLibrary?.Get(shapes[0].StyleId); if (style == null) { style = context.DocumentContainer?.StyleLibrary?.CurrentItem; } path = SkiaHelper.ToPathShape(context, result, style, context?.DocumentContainer?.PointTemplate); } result.Dispose(); } for (int i = 0; i < paths.Count; i++) { paths[i].Dispose(); } } } return(path); }