-
Notifications
You must be signed in to change notification settings - Fork 102
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flexbox: pass correct cross-axis available space when computing an it…
…em's intrinsic main size (+misc fixes) (#522) * Add tests for bevyengine/bevy#9350 * Pass accurate cross-axis available space when computing a flexbox item's intrinsic main size * Subtract child margin not parent margin when computing stretch-alignment known size * Add extra debug logs to flexbox algorithm * Apply margins to leaf nodes when computing available space for measure functions (cherry picked from commit dab541d)
- Loading branch information
Showing
13 changed files
with
478 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<!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> | ||
Test description | ||
</title> | ||
</head> | ||
<body> | ||
|
||
<div id="test-root" style="background: white; width: 300px; height: 300px; margin: auto; align-content: center; align-items: center; flex-direction: column;"> | ||
<div style="width: 100%; height: 20px; flex-direction: column; background: red;"></div> | ||
<div style="width: 100%; flex-grow: 1; padding: 20px; margin: 20px; flex-direction: column; background: red;"> | ||
<div style="width: 100%; height: 50px;"></div> | ||
<div style="/*width: 100%; */flex-grow: 1; align-content: center; align-items: center; justify-content: center; margin: 20px; background: blue;">HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH​HHHH</div> | ||
<div style="width: 100%; height: 50px;"></div> | ||
|
||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!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> | ||
Test description | ||
</title> | ||
</head> | ||
<body> | ||
|
||
<div id="test-root" style="flex-direction: column; width: 40px;"> | ||
<div style="flex-direction: column; flex-grow: 1;"> | ||
<div style="flex-grow: 1;">HH​HH​HH​HH</div> | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<!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> | ||
Test description | ||
</title> | ||
</head> | ||
<body> | ||
|
||
<div id="test-root" style="flex-direction: column;"> | ||
<div style="flex-direction: column; flex-grow: 1; width: 80px; margin: 0 20px;"> | ||
<div style="flex-grow: 1;">HH​HH​HH​HH​HH​HH​HH​HH</div> | ||
</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!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> | ||
Test description | ||
</title> | ||
</head> | ||
<body> | ||
|
||
<div id="test-root" style="flex-direction: column; width: 80px;"> | ||
<div style="flex-grow: 1; margin: 0 20px;">HH​HH​HH​HH​HH​HH​HH​HH</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<!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> | ||
Test description | ||
</title> | ||
</head> | ||
<body> | ||
|
||
<div id="test-root" style="flex-direction: column; width: 80px;"> | ||
<div style="margin: 20px;">HH​HH​HH​HH​HH​HH​HH​HH</div> | ||
</div> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.