computePixelAlignment static method

Alignment computePixelAlignment({
  1. required double width,
  2. required double height,
  3. required double left,
  4. required double top,
})

Returns the alignment of a widthxheight rectangle by leftxtop pixels.

Implementation

static Alignment computePixelAlignment({
  required final double width,
  required final double height,
  required final double left,
  required final double top,
}) =>
    Alignment(
      1.0 - 2 * left / width,
      1.0 - 2 * top / height,
    );