drawLine method

Point drawLine(
  1. Point p1,
  2. Point p2
)

Draw a line from p1 to p2.

Equivalent to PyMuPDF's shape.draw_line().

Implementation

Point drawLine(Point p1, Point p2) {
  _path.write('${_f(p1.x)} ${_f(p1.y)} m ');
  _path.write('${_f(p2.x)} ${_f(p2.y)} l ');
  _pathOps++;
  _lastPoint = p2;
  return p2;
}