simplifyRawPath function

PathOpsResult? simplifyRawPath(
  1. PathOpsPathBuffers path,
  2. PathFillType fillRule
)

Flattens a single path under its fill rule into overlap-free geometry. Returns null when simplification fails.

Implementation

PathOpsResult? simplifyRawPath(
  PathOpsPathBuffers path,
  PathFillType fillRule,
) {
  if (!path.isConsistent) {
    return null;
  }
  final buf = _NativeBuffers(path);
  try {
    return _toResult(_simplifyPath(
      buf.points,
      buf.verbs,
      buf.verbCount,
      fillRule.index,
    ));
  } finally {
    buf.free();
  }
}