Skip to content

Bevy: 100% height nodes overflow below certain window height (reproduction) #387

@doup

Description

@doup

taffy version

c2f99bf

Platform

  • Bevy + macOS
  • Taffy cargo test + macOS

What you did

<!DOCTYPE html>
<html lang="en">
<head>
<script src="../scripts/gentest/test_helper.js"></script>
<link rel="stylesheet" type="text/css" href="../scripts/gentest/test_base_style.css">
<title>
    Bevy #8017
</title>
</head>
<body>

<div id="test-root" style="display: flex; flex-direction: column; gap: 8px; width: 100%; height: 100%; padding: 8px;">
    <div style="display: flex; gap: 8px; width: 100%; height: 50%;">
        <div style="width: 100%; height: 100%;"></div>
        <div style="width: 100%; height: 100%;"></div>
    </div>
    <div style="display: flex; gap: 8px; width: 100%; height: 50%;">
        <div style="width: 100%; height: 100%;"></div>
        <div style="width: 100%; height: 100%;"></div>
    </div>
</div>

</body>
</html>

What went wrong

See bevyengine/bevy#8017 for details. TLDR;

  • Above certain window height works as expected
  • Below certain window height content overflows
  • I suspect that the threshold is: window.height + gap * 2

Additional information

I've run cargo gentest + cargo test, this is the error:

---- generated::bevy_8017::bevy_8017 stdout ----

Computed tree:
TREE
└──  FLEX [x: 0    y: 0    width: 24   height: 24  ] (7v1)
    ├──  FLEX [x: 8    y: 8    width: 8    height: 0   ] (3v1)
    │   ├──  LEAF [x: 0    y: 0    width: 0    height: 0   ] (1v1)
    │   └──  LEAF [x: 8    y: 0    width: 0    height: 0   ] (2v1)
    └──  FLEX [x: 8    y: 16   width: 8    height: 0   ] (6v1)
        ├──  LEAF [x: 0    y: 0    width: 0    height: 0   ] (4v1)
        └──  LEAF [x: 8    y: 0    width: 0    height: 0   ] (5v1)

thread 'generated::bevy_8017::bevy_8017' panicked at 'assertion failed: `(left == right)`
  left: `24.0`,
 right: `800.0`: width of node 7v1. Expected 800. Actual 24', tests/generated/bevy_8017.rs:106:5

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions