paint method

  1. @override
void paint(
  1. Context context
)
override

Draw itself and its children, according to the calculated box.offset

Implementation

@override
void paint(Context context) {
  super.paint(context);
  paintChild(context);

  final mat = context.canvas.getTransform();
  final lt = mat.transform3(Vector3(box!.left, box!.top, 0));
  context.document.pdfNames.addDest(
    name,
    context.page,
    posX: setX ? lt.x : null,
    posY: lt.y,
    posZ: zoom,
  );

  if (description != null) {
    final rb = mat.transform3(Vector3(box!.right, box!.top, 0));
    final iBox = PdfRect.fromLTRB(lt.x, lt.y, rb.x, rb.y);
    PdfAnnot(
      context.page,
      PdfAnnotText(rect: iBox, content: description!),
      objser: replaces?.ser,
      objgen: replaces?.gen ?? 0,
    );
  }
}