Code review comment for lp:~dandrader/unity/phablet_edgeDragGesture

Revision history for this message
Daniel d'Andrada (dandrader) wrote :

> 694 + case Upwards:
> 695 + return dY <= m_maxDeviation && qFabs(dX) <= (m_maxDeviation + dY) *
> m_wideningFactor + m_maxDeviation;
> 696 + case Downwards:
> 697 + return dY >= -m_maxDeviation && qFabs(dX) <= (m_maxDeviation + dY) *
> m_wideningFactor + m_maxDeviation;
> 698 + case Leftwards:
> 699 + return dX <= m_maxDeviation && qFabs(dY) <= (m_maxDeviation + dX) *
> m_wideningFactor + m_maxDeviation;
> 700 + default: // Rightwards:
> 701 + return dX >= -m_maxDeviation && qFabs(dY) <= (m_maxDeviation + dX) *
> m_wideningFactor + m_maxDeviation;
>
> Why adding maxDeviation before multiplying by the factor?

Because the widening starts from startPos - maxDeviation, not from startPos itself (see doc/DirectionalDragArea.svg)

« Back to merge proposal