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,
) {
if (this == otherAnchor) {
return position;
} else {
return position +
((otherAnchor.toVector2() - toVector2())..multiply(size));
}
}