34 std::optional<iRect> result = std::nullopt;
42 if (width <= space.m_width && height <= space.m_height)
45 result = std::make_optional<iRect>(space.m_xpos, space.m_ypos, width, height);
48 if (width == space.m_width && height == space.m_height)
54 else if (width == space.m_width)
57 space.m_ypos += height;
58 space.m_height -= height;
60 else if (height == space.m_height)
63 space.m_xpos += width;
64 space.m_width -= width;
69 iRect temp = {space.m_xpos + width, space.m_ypos, space.m_width - width, height};
72 space.m_height -= height;