• R/O
  • HTTP
  • SSH
  • HTTPS

Katie: Commit

C++ toolkit derived from the Qt 4.8 framework


Commit MetaInfo

Revision6fe67b22f90d9bf0c5ef6f45d1a6f996607339ec (tree)
Time2022-11-25 07:26:54
AuthorIvailo Monev <xakepa10@gmai...>
CommiterIvailo Monev

Log Message

move the QEasingCurve::Custom case to the switch in QEasingCurve::valueForProgress()

side note: only plasma and KWin set custom QEasingCurve function, both are
not used

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>

Change Summary

Incremental Difference

--- a/src/core/tools/qeasingcurve.cpp
+++ b/src/core/tools/qeasingcurve.cpp
@@ -559,10 +559,6 @@ qreal QEasingCurve::valueForProgress(qreal progress) const
559559 {
560560 progress = qBound<qreal>(0, progress, 1);
561561
562- if (d_ptr->func) {
563- return d_ptr->func(progress);
564- }
565-
566562 switch (d_ptr->type) {
567563 case QEasingCurve::Linear: {
568564 return easeNone(progress);
@@ -699,7 +695,13 @@ qreal QEasingCurve::valueForProgress(qreal progress) const
699695 case QEasingCurve::OutInBack: {
700696 return easeOutInBack(progress, BOUND_OVERSHOOT(d_ptr->over));
701697 }
702- default: {
698+ case QEasingCurve::Custom: {
699+ if (Q_LIKELY(d_ptr->func)) {
700+ return d_ptr->func(progress);
701+ }
702+ break;
703+ }
704+ case QEasingCurve::NCurveTypes: {
703705 break;
704706 }
705707 }
Show on old repository browser