resolveRect method

Rect resolveRect(
  1. PrettyQrPaintingContext context
)

Convert this instance into a floating-point rectangle whose coordinates are relative to a given QR module.

Implementation

Rect resolveRect(PrettyQrPaintingContext context) {
  final canvasSize = context.estimatedBounds.longestSide;
  final pointSize = canvasSize / context.matrix.dimension;
  return Rect.fromLTWH(pointSize * x, pointSize * y, pointSize, pointSize);
}