Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8117747

Path2D does not support relative and smoothing operations defined by SVG

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 7u6
    • 7u6
    • javafx

      The recent work to add the Path2D.arcTo() method allowed the SVG parser to delete a significant amount of custom code, but they still need to do a fair amount of delegation and wrapping of the Path2D object to implement all of the relative coordinate methods and the smooth curve methods, both of which are trivial to implement on the Path2D object itself. They could completely eliminate any wrapping classes if Path2D provided the following methods (based loosely on the associated SVG path commands):

      moveToRel(relx, rely)
      lineToRel(relx, rely)
      arcToRel(radiusx, radiusy, rot, largeArcs, sweep, relx, rely)
      quadToRel(relx1, rely1, relx2, rely2)
      curveToRel(relx1, rely1, relx2, rely2, relx3, rely3)

      quadToSmooth(x2, y2) // infers x1,y1 from a reflection of the last curve control point
      curveToSmooth(x2, y2, x3, y3) // also infers x1,y1 as quadToSmooth

      quadToSmoothRel(relx2, rely2)
      curveToSmoothRel(relx2, rely2, relx3, rely3)

            flar Jim Graham
            flar Jim Graham
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: