> 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
> 522 +qreal DirectionalDrag Area::wideningA ngle() const wideningFactor) * 180.0 / M_PI; Area::setWideni ngAngle( qreal angle) anged(angle) ;
> 523 +{
> 524 + // convert factor (which is in fact a tangent value) to its
> corresponding
> 525 + // angle in degrees
> 526 + return qAtan(m_
> 527 +}
> 528 +
> 529 +void DirectionalDrag
> 530 +{
> 531 + qreal newFactor = qTan(angle * M_PI / 180.0);
> 532 +
> 533 + if (m_wideningFactor != newFactor) {
> 534 + m_wideningFactor = newFactor;
> 535 + Q_EMIT wideningAngleCh
> 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