From fcaaf38c58ab9911feeda21a04aaa19bb1678b4a Mon Sep 17 00:00:00 2001 From: Anthony Nicholls Date: Mon, 3 Jun 2024 12:33:20 +0100 Subject: [PATCH] DemoRunner: Prevent infinite recursion in the AnimationEasing demo --- examples/GUI/AnimationEasingDemo.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/GUI/AnimationEasingDemo.h b/examples/GUI/AnimationEasingDemo.h index f3efcb5564..f879fde2c1 100644 --- a/examples/GUI/AnimationEasingDemo.h +++ b/examples/GUI/AnimationEasingDemo.h @@ -215,10 +215,10 @@ struct CubicBezier Point cp2 {}; Point cp3 { 1.0f, 1.0f }; - bool operator!= (const CubicBezier& other) + bool operator== (const CubicBezier& other) { const auto tie = [](const CubicBezier& x) { return std::tie (x.cp0, x.cp1, x.cp2, x.cp3); }; - return tie (*this) != tie (other); + return tie (*this) == tie (other); } }; @@ -255,7 +255,7 @@ public: void setCubicBezierCurve (const CubicBezier& newBezierCurve) { - if (std::exchange (bezierCurve, newBezierCurve) != newBezierCurve) + if (std::exchange (bezierCurve, newBezierCurve) == newBezierCurve) return; updateText(); @@ -323,7 +323,7 @@ class CubicBezierGraphComponent final : public Component public: void setCubicBezierCurve (const CubicBezier& newBezierCurve) { - if (std::exchange (bezierCurve, newBezierCurve) != newBezierCurve) + if (std::exchange (bezierCurve, newBezierCurve) == newBezierCurve) return; NullCheckedInvocation::invoke (onValueChange);