mirror of
https://github.com/slint-ui/slint.git
synced 2025-09-30 13:51:13 +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::max(preferred, other.preferred),
|
||||||
std::min(stretch, other.stretch) };
|
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 {
|
namespace private_api {
|
||||||
|
|
|
@ -377,6 +377,7 @@ impl CppType for Type {
|
||||||
}
|
}
|
||||||
Type::Brush => Some("slint::Brush".to_owned()),
|
Type::Brush => Some("slint::Brush".to_owned()),
|
||||||
Type::LayoutCache => Some("slint::SharedVector<float>".into()),
|
Type::LayoutCache => Some("slint::SharedVector<float>".into()),
|
||||||
|
Type::Easing => Some("slint::cbindgen_private::EasingCurve".into()),
|
||||||
_ => None,
|
_ => None,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue