/// <inheritdoc/> public IPathShape ToFillPathShape(IBaseShape shape) { var path = PathGeometryConverter.ToSKPath(shape); if (path == null) { return(null); } var factory = _serviceProvider.GetService <IFactory>(); var style = shape.Style != null ? (IShapeStyle)shape.Style?.Copy(null) : factory.CreateShapeStyle(ProjectEditorConfiguration.DefaulStyleName); using var brush = SkiaSharpDrawUtil.ToSKPaintBrush(style.Fill); var result = brush.GetFillPath(path, 1.0f); if (result != null) { if (result.IsEmpty) { result.Dispose(); return(null); } var geometry = PathGeometryConverter.ToPathGeometry(result, factory); var pathShape = factory.CreatePathShape( "Path", style, geometry, false, true); result.Dispose(); return(pathShape); } return(null); }
public virtual void UpdateStyle() { Fill = SkiaSharpDrawUtil.ToSKPaintBrush(Style.Fill); Stroke = SkiaSharpDrawUtil.ToSKPaintPen(Style, Style.Thickness); }
public override void UpdateStyle() { Fill = SkiaSharpDrawUtil.ToSKPaintBrush(Color); }