30 std::array<int32_t, 4> areas;
31 areas[0] = (y + height) * m_window->window()->width();
32 areas[1] = (x + width) * m_window->window()->height();
33 areas[2] = (m_window->window()->height() - y) * m_window->window()->width();
34 areas[3] = (m_window->window()->width() - x) * m_window->window()->height();
35 const auto minSide =
std::distance(areas.begin(), std::min_element(areas.begin(), areas.end()));
39 m_margins.setTop(std::max(m_margins.top(), y + height));
42 m_margins.setLeft(std::max(m_margins.left(), x + width));
45 m_margins.setBottom(std::max(m_margins.bottom(), y));
48 m_margins.setRight(std::max(m_margins.right(), x));