intersection method
Returns the intersection with another bounds.
Implementation
Bounds? intersection(Bounds other) {
if (!intersects(other)) return null;
return Bounds.fromLTRB(
left > other.left ? left : other.left,
top > other.top ? top : other.top,
right < other.right ? right : other.right,
bottom < other.bottom ? bottom : other.bottom,
);
}