public override void UpdateStyle() { if (Grid.GridStrokeColor != null) { Stroke = SkiaSharpDrawUtil.ToSKPaintPen(Grid.GridStrokeColor, Grid.GridStrokeThickness); } else { Stroke = null; } }
/// <inheritdoc/> public IPathShape ToStrokePathShape(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); var stroke = (IColor)style.Stroke.Copy(null); var fill = (IColor)style.Fill.Copy(null); style.Stroke = fill; style.Fill = stroke; using var pen = SkiaSharpDrawUtil.ToSKPaintPen(style, style.Thickness); var result = pen.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, true, false); result.Dispose(); return(pathShape); } return(null); }
public virtual void UpdateStyle() { Fill = SkiaSharpDrawUtil.ToSKPaintBrush(Style.Fill); Stroke = SkiaSharpDrawUtil.ToSKPaintPen(Style, Style.Thickness); }