Class EllipticalCurveTo

java.lang.Object
com.itextpdf.svg.renderers.path.impl.AbstractPathShape
com.itextpdf.svg.renderers.path.impl.EllipticalCurveTo
All Implemented Interfaces:
IPathShape

public class EllipticalCurveTo extends AbstractPathShape
Implements elliptical curveTo (A) segment of SVG's path element. Implemented in PDF as Bézier curves. Edge cases & value correction below always refer to https://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes For some calculations we need double precision floating point math, so we have forced all calculations to use double. However, float comparison is used instead of double comparison, because close coordinates can be considered equal.
  • Constructor Details

    • EllipticalCurveTo

      public EllipticalCurveTo()
      Creates an absolute Elliptical curveTo.
    • EllipticalCurveTo

      public EllipticalCurveTo (boolean relative)
      Creates a Elliptical curveTo. Set argument to true to create a relative EllipticalCurveTo.
      Parameters:
      relative - whether this is a relative EllipticalCurveTo or not
  • Method Details

    • setCoordinates

      public void setCoordinates (String[] inputCoordinates, Point previous)
      Description copied from interface: IPathShape
      This method sets the coordinates for the path painting operator and does internal preprocessing, if necessary
      Parameters:
      inputCoordinates - an array containing point values for path coordinates
      previous - the ending point of the previous operator, or, in broader terms, the point that the coordinates should be absolutized against, for relative operators
    • draw

      public void draw (PdfCanvas canvas)
      Description copied from interface: IPathShape
      Draws this instruction to a canvas object.
      Parameters:
      canvas - to which this instruction is drawn
    • getPathShapeRectangle

      public Rectangle getPathShapeRectangle (Point lastPoint)
      Description copied from class: AbstractPathShape
      Get bounding rectangle of the current path shape.
      Specified by:
      getPathShapeRectangle in interface IPathShape
      Overrides:
      getPathShapeRectangle in class AbstractPathShape
      Parameters:
      lastPoint - start point for this shape
      Returns:
      calculated rectangle