mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 06:11:16 +00:00
Allow for bigger indices in VisitChildrenResult
The indexes stored in `VisitChildrenResult` are unsigned. We have 64 bits to store two values and we need to have one special value as a flag. So accept any index `< u32::MAX` instead of `< i32::MAX`, which should allow for more data to be visited;-)
This commit is contained in:
parent
d13067db04
commit
79e2456ead
3 changed files with 15 additions and 15 deletions
|
@ -695,16 +695,16 @@ public:
|
|||
viewport_height->set(h);
|
||||
}
|
||||
|
||||
intptr_t visit(TraversalOrder order, private_api::ItemVisitorRefMut visitor) const
|
||||
uintptr_t visit(TraversalOrder order, private_api::ItemVisitorRefMut visitor) const
|
||||
{
|
||||
for (std::size_t i = 0; i < inner->data.size(); ++i) {
|
||||
int index = order == TraversalOrder::BackToFront ? i : inner->data.size() - 1 - i;
|
||||
auto ref = item_at(index);
|
||||
if (ref.vtable->visit_children_item(ref, -1, order, visitor) != -1) {
|
||||
if (ref.vtable->visit_children_item(ref, -1, order, visitor) != std::numeric_limits<uint64_t>::max()) {
|
||||
return index;
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
return std::numeric_limits<uint64_t>::max();
|
||||
}
|
||||
|
||||
vtable::VRef<private_api::ComponentVTable> item_at(int i) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue