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