Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CompoundShape

A PageShape that switches between two shapes at a specified Y-position. This may be used to build more complex shapes from simpler ones. Either or both of the shapes may themselves be CompoundShapes.

The following example uses a compound shape to create a "plus" or "double cup" shape, that is, a cup shape that flows around decorations in up to four corners (as opposed to CupShape, which handles no more than two):

// Create a "double cup" shape with this form:
//
//                 i1    i2
//                 +------+
//                 |      |
//             0 +-+      +-+ 0  y1
//               |          |
//             0 +---+  +---+ 0  y2
//                   |  |
//                   +--+
//                  i3  i4

new PageShape.CompoundShape(
    new PageShape.CupShape( i1, i2, y1, 0, 0 ),
    y2,
    new PageShape.InsetShape( i3, i4 )
);

Hierarchy

  • CompoundShape

Index

Constructors

Constructors

constructor

  • Creates a new CompoundShape that uses topShape until the Y-position y is reached, then switches to bottomShape.

    Parameters

    • topShape: PageShape

      the shape to use above y

    • y: number

      the Y-position at which to switch shapes

    • bottomShape: PageShape

      the shape to use below y

    Returns CompoundShape