toOtherAnchorPosition method
Take your position position
that is on this anchor and give back what
that position it would be on in anchor otherAnchor
with a size of
size
.
Implementation
Vector2 toOtherAnchorPosition(
Vector2 position,
Anchor otherAnchor,
Vector2 size, {
Vector2? out,
}) {
if (this == otherAnchor) {
return position;
} else {
return (out ?? Vector2.zero())
..setValues(otherAnchor.x - x, otherAnchor.y - y)
..multiply(size)
..add(position);
}
}