It might make sense to take advantage of Common::Rect::findIntersectingRect here. In fact, I can see this only used in rectSubtract below. So, it might be easier to siply use Common::Rect::intersects and Common::Rect::findIntersectingRect directly there.