Use Point2D in the C++ ffi when setting the window position

This commit is contained in:
Simon Hausmann 2022-07-08 14:39:00 +02:00 committed by Simon Hausmann
parent 94b4f81be6
commit d6f8048232
3 changed files with 10 additions and 4 deletions

View file

@ -185,7 +185,7 @@ public:
void set_position(const slint::Point<int> &pos)
{
cbindgen_private::slint_windowrc_set_position(&inner, pos.x, pos.y);
cbindgen_private::slint_windowrc_set_position(&inner, &pos);
}
slint::Size<unsigned int> size() const { return cbindgen_private::slint_windowrc_size(&inner); }

View file

@ -19,4 +19,11 @@ struct Point
bool operator==(const Point &other) const = default;
};
namespace cbindgen_private {
// The Size types are expanded to the Point2D<...> type from the euclid crate which
// is binary compatible with Point<T>
template<typename T>
using Point2D = Point<T>;
}
}