Skip to content

FlexRow in ListView #229

@rrveex

Description

@rrveex

Having a ListView of FlexRows doesn't work, because FlexRow.draw() asserts ctx.max.height != null.

This works, but I don't know if it's correct:

diff --git a/src/vxfw/ListView.zig b/src/vxfw/ListView.zig
index 309ebe8..2513cc9 100644
--- a/src/vxfw/ListView.zig
+++ b/src/vxfw/ListView.zig
@@ -233,7 +233,7 @@ fn insertChildren(
         // Set up constraints. We let the child be the entire height if it wants
         const child_ctx = ctx.withConstraints(
             .{ .width = max_size.width - child_offset, .height = 0 },
-            .{ .width = max_size.width - child_offset, .height = null },
+            .{ .width = max_size.width - child_offset, .height = max_size.height },
         );
 
         // Draw the child

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions