withinRect method
Returns the point that is this fraction within the given rect.
Implementation
PdfPoint withinRect(PdfRect rect) {
final halfWidth = rect.width / 2.0;
final halfHeight = rect.height / 2.0;
return PdfPoint(
rect.left + halfWidth + x * halfWidth,
rect.bottom + halfHeight + y * halfHeight,
);
}