mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
Use Point2D in the C++ ffi when setting the window position
This commit is contained in:
parent
94b4f81be6
commit
d6f8048232
3 changed files with 10 additions and 4 deletions
|
@ -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); }
|
||||
|
|
|
@ -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>;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue