toAlignment method

Alignment toAlignment(
  1. Size size
)

Implementation

Alignment toAlignment(Size size) {
  return Alignment(
    2 * (dx / size.width) - 1,
    2 * (dy / size.height) - 1,
  );
}