Example #1
0
        public PathShape ToStrokePathShape(IToolContext context, IBaseShape shape)
        {
            using (var geometry = ToPath(context, shape))
            {
                if (geometry != null)
                {
                    var style = context.DocumentContainer?.StyleLibrary?.Get(shape.StyleId);
                    if (style == null)
                    {
                        style = context.DocumentContainer?.StyleLibrary?.CurrentItem;
                    }

                    var path = SkiaHelper.ToStrokePath(context, style, geometry, _disposables);
                    if (path != null)
                    {
                        var union = SkiaHelper.Op(SKPathOp.Union, new[] { path, path });
                        if (union != null && !union.IsEmpty)
                        {
                            return(SkiaHelper.ToPathShape(context, union, context.DocumentContainer?.StyleLibrary?.CurrentItem, context?.DocumentContainer?.PointTemplate));
                        }
                    }
                }
            }
            return(null);
        }