Game Development Reference
In-Depth Information
1.5.1.3Left
result.Left() = m_to.Left();
The left alignment is trivial, we match the Left coordinate of the floating rectangle to the
Left of the fixed rectangle.
1.5.1.4Right
auto offset = to.Right() - from.Left();
result.Left() += (offset - result.Width());
Toaligntotheright,wefirstneedtocalculatehowmuchweshouldmovethefloatingrect-
angle's Left coordinate so that it is right aligned, then we subtract the floating rectangle's
width.
Search WWH ::




Custom Search