Ticket #7965: MythUI-negative-v2.patch

File MythUI-negative-v2.patch, 672 bytes (added by jppoet@…, 14 years ago)

Take into account parent's offset

  • libs/libmythui/mythrect.cpp

    old new void MythRect::CalculateArea(MythRect pa 
    6363        Y = (int) (m_percentY * (float)m_parentArea.height());
    6464    if (m_percentWidth > 0.0)
    6565        w = (int) (m_percentWidth * (float)(m_parentArea.width() - X));
     66    else if (w < 0)
     67        w += m_parentArea.width() - X + 1;
    6668    if (m_percentHeight > 0.0)
    6769        h = (int) (m_percentHeight * (float)(m_parentArea.height() - Y));
     70    else if (h < 0)
     71        h += m_parentArea.height() - Y + 1;
    6872
    6973    QRect::setRect(X,Y,w,h);
    7074