C++: fix (private) properties of type EasingCurve

tests/cases/properties/animation_props_depends.slint in previous commit
added a property<easing> and that didn't work with C++
This commit is contained in:
Olivier Goffart 2023-11-03 12:22:09 +01:00
parent 89c80f3b6d
commit f043234890
2 changed files with 10 additions and 0 deletions

View file

@ -269,6 +269,15 @@ inline LayoutInfo LayoutInfo::merge(const LayoutInfo &other) const
std::max(preferred, other.preferred),
std::min(stretch, other.stretch) };
}
inline bool operator==(const EasingCurve &a, const EasingCurve &b)
{
if (a.tag != b.tag) {
return false;
} else if (a.tag == EasingCurve::Tag::CubicBezier) {
return std::equal(a.cubic_bezier._0, a.cubic_bezier._0 + 4, b.cubic_bezier._0);
}
return true;
}
}
namespace private_api {