mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-03 18:29:09 +00:00
WIP: Add item_geometry to the ComponentVTable
(unused yet)
This commit is contained in:
parent
2a8ebb9752
commit
e0fd9a6105
16 changed files with 222 additions and 28 deletions
|
@ -85,6 +85,14 @@ inline ItemRef get_item_ref(ComponentRef component,
|
|||
return ItemRef { item.vtable, reinterpret_cast<char *>(component.instance) + item.offset };
|
||||
}
|
||||
|
||||
/// Convert a slint `{height: length, width: length, x: length, y: length}` to a Rect
|
||||
inline cbindgen_private::Rect convert_anonymous_rect(std::tuple<float, float, float, float> tuple)
|
||||
{
|
||||
// alphabetical order
|
||||
auto [h, w, x, y] = tuple;
|
||||
return cbindgen_private::Rect { .x = x, .y = y, .width = w, .height = h };
|
||||
}
|
||||
|
||||
inline void dealloc(const ComponentVTable *, uint8_t *ptr, vtable::Layout layout)
|
||||
{
|
||||
#ifdef __cpp_sized_deallocation
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue