Friday, July 08, 2005

zoom

zoom can position origin off-canvas, resulting in no rings

in SetNormOrigin, must clamp:

m_Origin.x = CLAMP(round(m_Size.cx * m_st.NormOrg.x), m_Canvas.left, m_Canvas.right - 1);
m_Origin.y = CLAMP(round(m_Size.cy * m_st.NormOrg.y), m_Canvas.top, m_Canvas.bottom - 1);

No comments: