mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
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:
parent
89c80f3b6d
commit
f043234890
2 changed files with 10 additions and 0 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue