Class BoundingBoxComputation

BoundingBoxComputation computes metrics for a bounding box by continuously taking canvas path commands.

Warning: This class is merely a crutch to get bounding box information without explicit metadata. This is likely to get deprecated following SMuFL support.

based on: https://github.com/canvg/canvg/blob/master/src/BoundingBox.ts (MIT License)

Hierarchy

  • BoundingBoxComputation

Constructors

Methods

  • Add bezier curve to BoundingBox.

    Parameters

    • p0x: number
    • p0y: number
    • p1x: number
    • p1y: number
    • p2x: number
    • p2y: number
    • p3x: number
    • p3y: number

    Returns void

  • Add point to BoundingBox.

    Parameters

    • x: number
    • y: number

    Returns void

  • Add quadratic curve to BoundingBox.

    Parameters

    • p0x: number
    • p0y: number
    • p1x: number
    • p1y: number
    • p2x: number
    • p2y: number

    Returns void

  • Add X to BoundingBox.

    Parameters

    • x: number

    Returns void

  • Add Y to BoundingBox.

    Parameters

    • y: number

    Returns void

  • Get calculated X1.

    Returns number

  • Get calculated Y1.

    Returns number

  • Get calculated height.

    Returns number

  • Get calculated width.

    Returns number