public bool SetPath(SKPath path) { if (path == null) { throw new ArgumentNullException(nameof(path)); } using var clip = new SKRegion(); var rect = SKRectI.Ceiling(path.Bounds); if (!rect.IsEmpty) clip.SetRect(rect); }
public bool SetPath(SKPath path) { if (path == null) { throw new ArgumentNullException(nameof(path)); } using (var clip = new SKRegion()) { var rect = SKRectI.Ceiling(path.Bounds); if (!rect.IsEmpty) { clip.SetRect(rect); } return(SkiaApi.sk_region_set_path(Handle, path.Handle, clip.Handle)); } }
public SKRegion(SKPath path) : this(SKRectI.Ceiling(path.Bounds)) { SetPath(path); }