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

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

> 522 +qreal DirectionalDragArea::wideningAngle() const
> 523 +{
> 524 + // convert factor (which is in fact a tangent value) to its
> corresponding
> 525 + // angle in degrees
> 526 + return qAtan(m_wideningFactor) * 180.0 / M_PI;
> 527 +}
> 528 +
> 529 +void DirectionalDragArea::setWideningAngle(qreal angle)
> 530 +{
> 531 + qreal newFactor = qTan(angle * M_PI / 180.0);
> 532 +
> 533 + if (m_wideningFactor != newFactor) {
> 534 + m_wideningFactor = newFactor;
> 535 + Q_EMIT wideningAngleChanged(angle);
> 536 + }
> 537 +}
>
> Depending on rounding errors, wideningAngle() might return a different value
> than was set (and emitted).

Fixed.

> Shouldn't this be int now that we're doing degrees?

No. Nothing stops you from having widening angles such as 9.36 degrees

« Back to merge proposal