Class PathData

java.lang.Object
com.codename1.art.PathData

public final class PathData extends Object

Parses SVG path data (the d attribute) into a GeneralPath.

Supports every command of SVG 1.1 in absolute and relative form, implicit repeats, and elliptical arcs, which are converted to cubic curves. Figma's fillGeometry uses the same syntax. Malformed data ends the path at the last complete command, as browsers do, rather than throwing.

  • Method Details

    • parse

      public static GeneralPath parse(String d)

      Parses path data.

      Parameters
      • d: the path data
      Returns

      the path; empty when d is null or has no valid command