public bool Op(SKPath other, SKPathOp op, SKPath result) { if (other == null) { throw new ArgumentNullException(nameof(other)); } if (result == null) { throw new ArgumentNullException(nameof(result)); } return(SkiaApi.sk_pathop_op(Handle, other.Handle, op, result.Handle)); }
public SKPath Op(SKPath other, SKPathOp op) { var result = new SKPath(); if (Op(other, op, result)) { return(result); } else { result.Dispose(); return(null); } }
private void OpFirstPathWithRest(SKPathOp op) { _remainderPath.Reset(); _firstPath.Reset(); for (var i = _pathContents.Count - 1; i >= 1; i--) { var content = _pathContents[i]; if (content is ContentGroup contentGroup) { var pathList = contentGroup.PathList; for (var j = pathList.Count - 1; j >= 0; j--) { var path = pathList[j].Path; path.Transform(contentGroup.TransformationMatrix.ToSKMatrix()); _remainderPath.AddPath(path); } } else { _remainderPath.AddPath(content.Path); } } var lastContent = _pathContents[0]; if (lastContent is ContentGroup group) { var pathList = group.PathList; for (var j = 0; j < pathList.Count; j++) { var path = pathList[j].Path; path.Transform(group.TransformationMatrix.ToSKMatrix()); _firstPath.AddPath(path); } } else { _firstPath = lastContent.Path; } _firstPath.Op(_remainderPath, op, _firstPath); }
internal static SKPath Op(SKPathOp op, IList <SKPath> paths) { if (paths == null || paths.Count <= 0) { return(null); } if (paths.Count == 1) { using (var empty = new SKPath() { FillType = paths[0].FillType }) { return(empty.Op(paths[0], op)); } } else { var haveResult = false; var result = new SKPath(paths[0]) { FillType = paths[0].FillType }; for (int i = 1; i < paths.Count; i++) { var next = result.Op(paths[i], op); if (next != null) { result.Dispose(); result = next; haveResult = true; } } return(haveResult ? result : null); } }
public void Add(SKPath path, SKPathOp op) { SkiaApi.sk_opbuilder_add(Handle, path.Handle, op); }
/* * Set this path to the result of applying the Op to the two specified paths. The resulting path will be constructed from non-overlapping contours. The curve order is reduced where possible so that cubics may be turned into quadratics, and quadratics maybe turned into lines. * Path1: The first operand (for difference, the minuend) * Path2: The second operand (for difference, the subtrahend) */ public void Op(Path path1, Path path2, SKPathOp op) { Contours.Add(new OpContour(path1, path2, op)); }
public OpContour(Path path1, Path path2, SKPathOp opType) { this.path1 = path1; this.path2 = path2; OpType = opType; }
public extern static void sk_opbuilder_add(sk_opbuilder_t builder, sk_path_t path, SKPathOp op);
public extern static bool sk_pathop_op(sk_path_t one, sk_path_t two, SKPathOp op, sk_path_t result);
public void Add (SKPath path, SKPathOp op) { SkiaApi.sk_opbuilder_add (Handle, path.Handle, op); }
public SKPath Op (SKPath other, SKPathOp op) { var result = new SKPath (); if (Op (other, op, result)) { return result; } else { result.Dispose (); return null; } }
public bool Op (SKPath other, SKPathOp op, SKPath result) { if (other == null) throw new ArgumentNullException (nameof (other)); if (result == null) throw new ArgumentNullException (nameof (result)); return SkiaApi.sk_pathop_op (Handle, other.Handle, op, result.Handle); }