Compare commits
1 Commits
export-D70
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
|
26232c33d7 |
23
.github/actions/clang-format/action.yml
vendored
Normal file
23
.github/actions/clang-format/action.yml
vendored
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
name: Clang Format
|
||||||
|
inputs:
|
||||||
|
directory:
|
||||||
|
description: Directory to Lint
|
||||||
|
required: true
|
||||||
|
version:
|
||||||
|
description: LLVM version to use # Should be kept roughly in sync with arcanist
|
||||||
|
required: false
|
||||||
|
default: 12
|
||||||
|
|
||||||
|
runs:
|
||||||
|
using: "composite"
|
||||||
|
steps:
|
||||||
|
- name: Install
|
||||||
|
shell: bash
|
||||||
|
run: sudo apt-get install -y clang-format-${{ inputs.version }}
|
||||||
|
|
||||||
|
- name: clang-format
|
||||||
|
working-directory: ${{ inputs.directory }}
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
BASHOPTS: extglob:nullglob
|
||||||
|
run: clang-format-${{ inputs.version }} --dry-run --Werror **/*.{h,hh,hpp,c,cpp,cc,m,mm}
|
1
.github/actions/setup-cpp/action.yml
vendored
1
.github/actions/setup-cpp/action.yml
vendored
@@ -16,7 +16,6 @@ runs:
|
|||||||
if: ${{ inputs.toolchain == 'Clang' }}
|
if: ${{ inputs.toolchain == 'Clang' }}
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
sudo apt-get install -y libc++-dev libc++abi-dev
|
|
||||||
echo "CC=/usr/bin/clang" >> $GITHUB_ENV
|
echo "CC=/usr/bin/clang" >> $GITHUB_ENV
|
||||||
echo "CXX=/usr/bin/clang++" >> $GITHUB_ENV
|
echo "CXX=/usr/bin/clang++" >> $GITHUB_ENV
|
||||||
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
|
echo "CXXFLAGS=-stdlib=libc++" >> $GITHUB_ENV
|
||||||
|
@@ -24,7 +24,7 @@ jobs:
|
|||||||
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
ORG_GRADLE_PROJECT_SIGNING_PWD: ${{ secrets.ORG_GRADLE_PROJECT_SIGNING_PWD }}
|
||||||
|
|
||||||
- name: Upload Build Artifacts
|
- name: Upload Build Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: 'snapshot-artifacts'
|
name: 'snapshot-artifacts'
|
||||||
path: '~/.m2/repository/'
|
path: '~/.m2/repository/'
|
||||||
|
@@ -23,7 +23,7 @@ jobs:
|
|||||||
ORG_GRADLE_PROJECT_USE_SNAPSHOT: true
|
ORG_GRADLE_PROJECT_USE_SNAPSHOT: true
|
||||||
|
|
||||||
- name: Upload Build Artifacts
|
- name: Upload Build Artifacts
|
||||||
uses: actions/upload-artifact@v4
|
uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: 'snapshot-artifacts'
|
name: 'snapshot-artifacts'
|
||||||
path: '~/.m2/repository/'
|
path: '~/.m2/repository/'
|
||||||
|
10
.github/workflows/validate-cpp.yml
vendored
10
.github/workflows/validate-cpp.yml
vendored
@@ -97,3 +97,13 @@ jobs:
|
|||||||
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release
|
cmake -S . -B build -G Ninja -D CMAKE_BUILD_TYPE=Release
|
||||||
cmake --build build
|
cmake --build build
|
||||||
working-directory: capture
|
working-directory: capture
|
||||||
|
|
||||||
|
clang-format:
|
||||||
|
name: Format
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
- name: clang-format
|
||||||
|
uses: ./.github/actions/clang-format
|
||||||
|
2
.github/workflows/validate-js.yml
vendored
2
.github/workflows/validate-js.yml
vendored
@@ -110,7 +110,7 @@ jobs:
|
|||||||
run: yarn pack --filename yoga-layout.tar.gz
|
run: yarn pack --filename yoga-layout.tar.gz
|
||||||
working-directory: javascript
|
working-directory: javascript
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v4
|
- uses: actions/upload-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: npm-package
|
name: npm-package
|
||||||
path: javascript/yoga-layout.tar.gz
|
path: javascript/yoga-layout.tar.gz
|
||||||
|
@@ -225,17 +225,17 @@ static void serializeTreeImpl(
|
|||||||
appendEdges<&YGNodeStyleGetPosition>(
|
appendEdges<&YGNodeStyleGetPosition>(
|
||||||
j, "position", node, defaultNode.get());
|
j, "position", node, defaultNode.get());
|
||||||
|
|
||||||
appendYGValueIfNotDefault(
|
appendFloatIfNotDefault(
|
||||||
j["style"],
|
j["style"],
|
||||||
"gap",
|
"gap",
|
||||||
YGNodeStyleGetGap(node, YGGutterAll),
|
YGNodeStyleGetGap(node, YGGutterAll),
|
||||||
YGNodeStyleGetGap(defaultNode.get(), YGGutterAll));
|
YGNodeStyleGetGap(defaultNode.get(), YGGutterAll));
|
||||||
appendYGValueIfNotDefault(
|
appendFloatIfNotDefault(
|
||||||
j["style"],
|
j["style"],
|
||||||
"column-gap",
|
"column-gap",
|
||||||
YGNodeStyleGetGap(node, YGGutterColumn),
|
YGNodeStyleGetGap(node, YGGutterColumn),
|
||||||
YGNodeStyleGetGap(defaultNode.get(), YGGutterColumn));
|
YGNodeStyleGetGap(defaultNode.get(), YGGutterColumn));
|
||||||
appendYGValueIfNotDefault(
|
appendFloatIfNotDefault(
|
||||||
j["style"],
|
j["style"],
|
||||||
"row-gap",
|
"row-gap",
|
||||||
YGNodeStyleGetGap(node, YGGutterRow),
|
YGNodeStyleGetGap(node, YGGutterRow),
|
||||||
|
@@ -19,8 +19,8 @@ add_compile_options(
|
|||||||
# Enable warnings and warnings as errors
|
# Enable warnings and warnings as errors
|
||||||
/W4
|
/W4
|
||||||
/WX
|
/WX
|
||||||
# Enable RTTI
|
# Disable RTTI
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:/GR>
|
$<$<COMPILE_LANGUAGE:CXX>:/GR->
|
||||||
# Use /O2 (Maximize Speed)
|
# Use /O2 (Maximize Speed)
|
||||||
$<$<CONFIG:RELEASE>:/O2>)
|
$<$<CONFIG:RELEASE>:/O2>)
|
||||||
|
|
||||||
@@ -34,8 +34,8 @@ add_compile_options(
|
|||||||
# Enable warnings and warnings as errors
|
# Enable warnings and warnings as errors
|
||||||
-Wall
|
-Wall
|
||||||
-Werror
|
-Werror
|
||||||
# Enable RTTI
|
# Disable RTTI
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:-frtti>
|
$<$<COMPILE_LANGUAGE:CXX>:-fno-rtti>
|
||||||
# Use -O2 (prioritize speed)
|
# Use -O2 (prioritize speed)
|
||||||
$<$<CONFIG:RELEASE>:-O2>
|
$<$<CONFIG:RELEASE>:-O2>
|
||||||
# Enable separate sections per function/data item
|
# Enable separate sections per function/data item
|
||||||
|
@@ -157,31 +157,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="contains_inner_text_max_width_max_height_column" style="width:2000px; align-items: flex-start;">
|
|
||||||
<div style="max-width: 50px;">
|
|
||||||
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed eleifasd et tortor ac auctor. Integer at
|
|
||||||
volutpat
|
|
||||||
libero, sed elementum dui interdum id. Aliquam consectetur massa vel neque aliquet, quis consequat risus
|
|
||||||
fringilla. Fusce rhoncus ipsum tempor eros aliquam, vel tempus metus ullamcorper. Nam at nulla sed tellus
|
|
||||||
vestibulum fringilla vel sit amet ligula. Proin velit lectus, euismod sit amet quam vel ultricies dolor,
|
|
||||||
vitae
|
|
||||||
finibus lorem ipsum. Pellentesque molestie at mi sit amet dictum. Donec vehicula lacinia felis sit amet
|
|
||||||
consectetur. Praesent sodales enim sapien, sed varius ipsum pellentesque vel. Aenean eu mi eu justo
|
|
||||||
tincidunt
|
|
||||||
finibus vel sit amet ipsum. Sed bibasdum purus vel ipsum sagittis, quis fermentum dolor lobortis. Etiam
|
|
||||||
vulputate eleifasd lectus vel varius.
|
|
||||||
Phasellus imperdiet lectus sit amet ipsum egestas, ut bibasdum ipsum malesuada. Vestibulum ante ipsum primis
|
|
||||||
in
|
|
||||||
faucibus orci luctus et ultrices posuere cubilia Curae; Sed mollis eros sit amet elit porttitor, vel
|
|
||||||
venenatis
|
|
||||||
turpis venenatis. Nulla tempus tortor at eros efficitur, sit amet dapibus ipsum malesuada. Ut at mauris sed
|
|
||||||
nunc
|
|
||||||
malesuada convallis. Duis id sem vel magna varius eleifasd vel at est. Donec eget orci a ipsum tempor
|
|
||||||
lobortis.
|
|
||||||
Sed at consectetur ipsum.
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
<div id="contains_inner_text_max_width" style="width:2000px;height:2000px;align-items: flex-start;">
|
<div id="contains_inner_text_max_width" style="width:2000px;height:2000px;align-items: flex-start;">
|
||||||
<div style="flex-direction:row;max-width:100px">
|
<div style="flex-direction:row;max-width:100px">
|
||||||
@@ -254,7 +229,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="fit_content_width" style="width: 90px;">
|
<div data-disabled="true" id="fit_content_width" style="width: 90px; position: relative;">
|
||||||
<div style="flex-direction: row; width: fit-content; flex-wrap: wrap;">
|
<div style="flex-direction: row; width: fit-content; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -265,7 +240,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="stretch_width" style="width: 500px;">
|
<div data-disabled="true" id="stretch_width" style="width: 500px; position: relative;">
|
||||||
<div style="flex-direction: row; width: -webkit-fill-available; flex-wrap: wrap;">
|
<div style="flex-direction: row; width: -webkit-fill-available; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -285,7 +260,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="fit_content_height" style="height: 90px; ">
|
<div data-disabled="true" id="fit_content_height" style="height: 90px; position: relative;">
|
||||||
<div style="height: fit-content; flex-wrap: wrap;">
|
<div style="height: fit-content; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -296,7 +271,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="stretch_height" style="height: 500px;">
|
<div data-disabled="true" id="stretch_height" style="height: 500px; position: relative;">
|
||||||
<div style="height: -webkit-fill-available; flex-wrap: wrap;">
|
<div style="height: -webkit-fill-available; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -316,7 +291,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="fit_content_flex_basis_column" style="height: 90px;">
|
<div data-disabled="true" id="fit_content_flex_basis_column" style="height: 90px; position: relative;">
|
||||||
<div style="flex-basis: fit-content; flex-wrap: wrap;">
|
<div style="flex-basis: fit-content; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -327,7 +302,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="stretch_flex_basis_column" style="height: 500px;">
|
<div data-disabled="true" id="stretch_flex_basis_column" style="height: 500px; position: relative;">
|
||||||
<div style="flex-basis: -webkit-fill-available; flex-wrap: wrap;">
|
<div style="flex-basis: -webkit-fill-available; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -338,7 +313,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="max_content_flex_basis_row" style="flex-direction: row; flex-basis: max-content; flex-wrap: wrap;">
|
<div id="max_content_flex_basis_row" style="flex-direction: row; flex-basis: max-content; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100px; height: 500px;">
|
<div style="width: 100px; height: 500px;">
|
||||||
@@ -347,7 +322,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="fit_content_flex_basis_row" style="width: 90px;">
|
<div data-disabled="true" id="fit_content_flex_basis_row" style="width: 90px; position: relative;">
|
||||||
<div style="flex-direction: row; flex-basis: fit-content; flex-wrap: wrap;">
|
<div style="flex-direction: row; flex-basis: fit-content; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -358,7 +333,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="stretch_flex_basis_row" style="width: 500px;">
|
<div data-disabled="true" id="stretch_flex_basis_row" style="width: 500px; position: relative;">
|
||||||
<div style="flex-direction: row; flex-basis: -webkit-fill-available; flex-wrap: wrap;">
|
<div style="flex-direction: row; flex-basis: -webkit-fill-available; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -369,8 +344,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="max_content_max_width"
|
<div data-disabled="true" id="max_content_max_width" style="flex-direction: row; max-width:max-content; width: 200px; flex-wrap: wrap;">
|
||||||
style="flex-direction: row; max-width:max-content; width: 200px; flex-wrap: wrap;">
|
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100px; height: 50px;">
|
<div style="width: 100px; height: 50px;">
|
||||||
@@ -379,7 +353,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="fit_content_max_width" style="width: 90px;">
|
<div data-disabled="true" id="fit_content_max_width" style="width: 90px; position: relative;">
|
||||||
<div style="flex-direction: row; max-width: fit-content; width: 110px; flex-wrap: wrap;">
|
<div style="flex-direction: row; max-width: fit-content; width: 110px; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -390,7 +364,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="stretch_max_width" style="width: 500px;">
|
<div data-disabled="true" id="stretch_max_width" style="width: 500px; position: relative;">
|
||||||
<div style="flex-direction: row; max-width: -webkit-fill-available; width: 600px; flex-wrap: wrap;">
|
<div style="flex-direction: row; max-width: -webkit-fill-available; width: 600px; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -401,8 +375,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="max_content_min_width"
|
<div data-disabled="true" id="max_content_min_width" style="flex-direction: row; min-width:max-content; width: 100px; flex-wrap: wrap;">
|
||||||
style="flex-direction: row; min-width:max-content; width: 100px; flex-wrap: wrap;">
|
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
<div style="width: 100px; height: 50px;">
|
<div style="width: 100px; height: 50px;">
|
||||||
@@ -411,7 +384,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="fit_content_min_width" style="width: 90px;">
|
<div data-disabled="true" id="fit_content_min_width" style="width: 90px; position: relative;">
|
||||||
<div style="flex-direction: row; min-width: fit-content; width: 90px; flex-wrap: wrap;">
|
<div style="flex-direction: row; min-width: fit-content; width: 90px; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -422,7 +395,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="stretch_min_width" style="width: 500px;">
|
<div data-disabled="true" id="stretch_min_width" style="width: 500px; position: relative;">
|
||||||
<div style="flex-direction: row; min-width: -webkit-fill-available; width: 400px; flex-wrap: wrap;">
|
<div style="flex-direction: row; min-width: -webkit-fill-available; width: 400px; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -442,7 +415,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="fit_content_max_height" style="height: 90px;">
|
<div data-disabled="true" id="fit_content_max_height" style="height: 90px; position: relative;">
|
||||||
<div style="max-height: fit-content; height: 110px; flex-wrap: wrap;">
|
<div style="max-height: fit-content; height: 110px; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -453,7 +426,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="stretch_max_height" style="height: 500px;">
|
<div data-disabled="true" id="stretch_max_height" style="height: 500px; position: relative;">
|
||||||
<div style="max-height: -webkit-fill-available; flex-wrap: wrap; height: 600px;">
|
<div style="max-height: -webkit-fill-available; flex-wrap: wrap; height: 600px;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -473,7 +446,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="fit_content_min_height" style="height: 90px;">
|
<div data-disabled="true" id="fit_content_min_height" style="height: 90px; position: relative;">
|
||||||
<div style="min-height: fit-content; height: 90px; flex-wrap: wrap;">
|
<div style="min-height: fit-content; height: 90px; flex-wrap: wrap;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -484,7 +457,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="stretch_min_height" style="height: 500px;">
|
<div data-disabled="true" id="stretch_min_height" style="height: 500px; position: relative;">
|
||||||
<div style="min-height: -webkit-fill-available; flex-wrap: wrap; height: 400px;">
|
<div style="min-height: -webkit-fill-available; flex-wrap: wrap; height: 400px;">
|
||||||
<div style="width: 50px; height: 50px;">
|
<div style="width: 50px; height: 50px;">
|
||||||
</div>
|
</div>
|
||||||
@@ -494,75 +467,3 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div data-disabled="true" id="text_max_content_width" style="width: 200px">
|
|
||||||
<div style="width: max-content;">
|
|
||||||
<div style="flex-direction:row;">
|
|
||||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-disabled="true" id="text_stretch_width" style="width: 200px">
|
|
||||||
<div style="width: -webkit-fill-available;">
|
|
||||||
<div style="flex-direction:row;">
|
|
||||||
Lorem ipsum dolor sit amet
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-disabled="true" id="text_fit_content_width" style="width: 200px">
|
|
||||||
<div style="width: fit-content;">
|
|
||||||
<div style="flex-direction:row;">
|
|
||||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-disabled="true" id="text_max_content_min_width" style="width: 200px">
|
|
||||||
<div style="min-width: max-content; width: 200px;">
|
|
||||||
<div style="flex-direction:row;">
|
|
||||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-disabled="true" id="text_stretch_min_width" style="width: 200px">
|
|
||||||
<div style="min-width: -webkit-fill-available; width: 100px;">
|
|
||||||
<div style="flex-direction:row;">
|
|
||||||
Lorem ipsum dolor sit amet
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-disabled="true" data-disabled="true" id="text_fit_content_min_width" style="width: 200px">
|
|
||||||
<div style="min-width: fit-content; width: 300px">
|
|
||||||
<div style="flex-direction:row;">
|
|
||||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-disabled="true" id="text_max_content_max_width" style="width: 200px">
|
|
||||||
<div style="max-width: max-content; width: 2000px;">
|
|
||||||
<div style="flex-direction:row;">
|
|
||||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-disabled="true" id="text_stretch_max_width" style="width: 200px">
|
|
||||||
<div style="max-width: -webkit-fill-available; width: 300px;">
|
|
||||||
<div style="flex-direction:row;">
|
|
||||||
Lorem ipsum dolor sit amet
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div data-disabled="true" id="text_fit_content_max_width" style="width: 200px">
|
|
||||||
<div style="max-width: fit-content; width: 1000px">
|
|
||||||
<div style="flex-direction:row;">
|
|
||||||
Lorem ipsum sdafhasdfkjlasdhlkajsfhasldkfhasdlkahsdflkjasdhflaksdfasdlkjhasdlfjahsdfljkasdhalsdfhas dolor sit amet
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
@@ -502,7 +502,7 @@ CPPEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
YGNodeSetMeasureFunc: {
|
YGNodeSetMeasureFunc: {
|
||||||
value: function (nodeName, innerText, _) {
|
value: function (nodeName, innerText) {
|
||||||
this.push(`YGNodeSetContext(${nodeName}, (void*)"${innerText}");`);
|
this.push(`YGNodeSetContext(${nodeName}, (void*)"${innerText}");`);
|
||||||
this.push(
|
this.push(
|
||||||
`YGNodeSetMeasureFunc(${nodeName}, &facebook::yoga::test::IntrinsicSizeMeasure);`,
|
`YGNodeSetMeasureFunc(${nodeName}, &facebook::yoga::test::IntrinsicSizeMeasure);`,
|
||||||
|
@@ -467,7 +467,7 @@ JavaEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
YGNodeSetMeasureFunc: {
|
YGNodeSetMeasureFunc: {
|
||||||
value: function (nodeName, innerText, _) {
|
value: function (nodeName, innerText) {
|
||||||
this.push(`${nodeName}.setData("${innerText}");`);
|
this.push(`${nodeName}.setData("${innerText}");`);
|
||||||
this.push(
|
this.push(
|
||||||
`${nodeName}.setMeasureFunction(new TestUtils.intrinsicMeasureFunction());`,
|
`${nodeName}.setMeasureFunction(new TestUtils.intrinsicMeasureFunction());`,
|
||||||
|
@@ -429,11 +429,9 @@ JavascriptEmitter.prototype = Object.create(Emitter.prototype, {
|
|||||||
},
|
},
|
||||||
|
|
||||||
YGNodeSetMeasureFunc: {
|
YGNodeSetMeasureFunc: {
|
||||||
value: function (nodeName, innerText, flexDirection) {
|
value: function (nodeName, innerText) {
|
||||||
this.push(
|
this.push(
|
||||||
`${nodeName}.setMeasureFunc(instrinsicSizeMeasureFunc.bind({text: "${innerText}", flexDirection: ${toValueJavascript(
|
`${nodeName}.setMeasureFunc(instrinsicSizeMeasureFunc.bind("${innerText}"));`,
|
||||||
flexDirection,
|
|
||||||
)}}));`,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
@@ -533,11 +533,7 @@ function setupTestTree(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (node.innerText && node.children.length === 0) {
|
if (node.innerText && node.children.length === 0) {
|
||||||
e.YGNodeSetMeasureFunc(
|
e.YGNodeSetMeasureFunc(nodeName, node.innerText);
|
||||||
nodeName,
|
|
||||||
node.innerText,
|
|
||||||
flexDirectionValue(e, node.style['flex-direction']),
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (let i = 0; i < node.children.length; i++) {
|
for (let i = 0; i < node.children.length; i++) {
|
||||||
|
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
BIN
gradle/wrapper/gradle-wrapper.jar
vendored
Binary file not shown.
3
gradle/wrapper/gradle-wrapper.properties
vendored
3
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -1,7 +1,6 @@
|
|||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip
|
||||||
networkTimeout=10000
|
networkTimeout=10000
|
||||||
validateDistributionUrl=true
|
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
|
26
gradlew
vendored
26
gradlew
vendored
@@ -15,8 +15,6 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
# SPDX-License-Identifier: Apache-2.0
|
|
||||||
#
|
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
#
|
#
|
||||||
@@ -57,7 +55,7 @@
|
|||||||
# Darwin, MinGW, and NonStop.
|
# Darwin, MinGW, and NonStop.
|
||||||
#
|
#
|
||||||
# (3) This script is generated from the Groovy template
|
# (3) This script is generated from the Groovy template
|
||||||
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
# within the Gradle project.
|
# within the Gradle project.
|
||||||
#
|
#
|
||||||
# You can find Gradle at https://github.com/gradle/gradle/.
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
@@ -85,8 +83,7 @@ done
|
|||||||
# This is normally unused
|
# This is normally unused
|
||||||
# shellcheck disable=SC2034
|
# shellcheck disable=SC2034
|
||||||
APP_BASE_NAME=${0##*/}
|
APP_BASE_NAME=${0##*/}
|
||||||
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s\n' "$PWD" ) || exit
|
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD=maximum
|
MAX_FD=maximum
|
||||||
@@ -133,21 +130,18 @@ location of your Java installation."
|
|||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD=java
|
JAVACMD=java
|
||||||
if ! command -v java >/dev/null 2>&1
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
then
|
|
||||||
die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
case $MAX_FD in #(
|
case $MAX_FD in #(
|
||||||
max*)
|
max*)
|
||||||
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC2039,SC3045
|
# shellcheck disable=SC3045
|
||||||
MAX_FD=$( ulimit -H -n ) ||
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
warn "Could not query maximum file descriptor limit"
|
warn "Could not query maximum file descriptor limit"
|
||||||
esac
|
esac
|
||||||
@@ -155,7 +149,7 @@ if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
|||||||
'' | soft) :;; #(
|
'' | soft) :;; #(
|
||||||
*)
|
*)
|
||||||
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
# shellcheck disable=SC2039,SC3045
|
# shellcheck disable=SC3045
|
||||||
ulimit -n "$MAX_FD" ||
|
ulimit -n "$MAX_FD" ||
|
||||||
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
esac
|
esac
|
||||||
@@ -204,11 +198,11 @@ fi
|
|||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Collect all arguments for the java command:
|
# Collect all arguments for the java command;
|
||||||
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
# and any embedded shellness will be escaped.
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
|
# double quotes to make sure that they get re-expanded; and
|
||||||
# treated as '${Hostname}' itself on the command line.
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
|
|
||||||
set -- \
|
set -- \
|
||||||
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
22
gradlew.bat
vendored
22
gradlew.bat
vendored
@@ -13,8 +13,6 @@
|
|||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
@rem SPDX-License-Identifier: Apache-2.0
|
|
||||||
@rem
|
|
||||||
|
|
||||||
@if "%DEBUG%"=="" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@@ -45,11 +43,11 @@ set JAVA_EXE=java.exe
|
|||||||
%JAVA_EXE% -version >NUL 2>&1
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
if %ERRORLEVEL% equ 0 goto execute
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
|
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
@@ -59,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
|||||||
|
|
||||||
if exist "%JAVA_EXE%" goto execute
|
if exist "%JAVA_EXE%" goto execute
|
||||||
|
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
echo. 1>&2
|
echo.
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
echo location of your Java installation. 1>&2
|
echo location of your Java installation.
|
||||||
|
|
||||||
goto fail
|
goto fail
|
||||||
|
|
||||||
|
@@ -1,17 +1,4 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
|
||||||
<!--
|
|
||||||
Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
||||||
|
|
||||||
This source code is licensed under the MIT license found in the
|
|
||||||
LICENSE file in the root directory of this source tree.
|
|
||||||
-->
|
|
||||||
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
|
||||||
package="com.facebook.yoga"
|
|
||||||
android:versionCode="1"
|
|
||||||
android:versionName="1.0"
|
|
||||||
>
|
|
||||||
|
|
||||||
<application/>
|
<application/>
|
||||||
|
|
||||||
|
@@ -30,7 +30,6 @@ android {
|
|||||||
consumerProguardFiles("proguard-rules.pro")
|
consumerProguardFiles("proguard-rules.pro")
|
||||||
|
|
||||||
ndk { abiFilters.addAll(setOf("x86", "x86_64", "armeabi-v7a", "arm64-v8a")) }
|
ndk { abiFilters.addAll(setOf("x86", "x86_64", "armeabi-v7a", "arm64-v8a")) }
|
||||||
externalNativeBuild { cmake { arguments("-DANDROID_SUPPORT_FLEXIBLE_PAGE_SIZES=ON") } }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
externalNativeBuild { cmake { path("CMakeLists.txt") } }
|
externalNativeBuild { cmake { path("CMakeLists.txt") } }
|
||||||
|
@@ -130,7 +130,7 @@ public class YogaNative {
|
|||||||
static native void jni_YGNodeStyleSetMaxHeightStretchJNI(long nativePointer);
|
static native void jni_YGNodeStyleSetMaxHeightStretchJNI(long nativePointer);
|
||||||
static native float jni_YGNodeStyleGetAspectRatioJNI(long nativePointer);
|
static native float jni_YGNodeStyleGetAspectRatioJNI(long nativePointer);
|
||||||
static native void jni_YGNodeStyleSetAspectRatioJNI(long nativePointer, float aspectRatio);
|
static native void jni_YGNodeStyleSetAspectRatioJNI(long nativePointer, float aspectRatio);
|
||||||
static native long jni_YGNodeStyleGetGapJNI(long nativePointer, int gutter);
|
static native float jni_YGNodeStyleGetGapJNI(long nativePointer, int gutter);
|
||||||
static native void jni_YGNodeStyleSetGapJNI(long nativePointer, int gutter, float gapLength);
|
static native void jni_YGNodeStyleSetGapJNI(long nativePointer, int gutter, float gapLength);
|
||||||
static native void jni_YGNodeStyleSetGapPercentJNI(long nativePointer, int gutter, float gapLength);
|
static native void jni_YGNodeStyleSetGapPercentJNI(long nativePointer, int gutter, float gapLength);
|
||||||
static native void jni_YGNodeSetHasMeasureFuncJNI(long nativePointer, boolean hasMeasureFunc);
|
static native void jni_YGNodeSetHasMeasureFuncJNI(long nativePointer, boolean hasMeasureFunc);
|
||||||
|
@@ -236,7 +236,7 @@ public abstract class YogaNode implements YogaProps {
|
|||||||
|
|
||||||
public abstract void setAspectRatio(float aspectRatio);
|
public abstract void setAspectRatio(float aspectRatio);
|
||||||
|
|
||||||
public abstract YogaValue getGap(YogaGutter gutter);
|
public abstract float getGap(YogaGutter gutter);
|
||||||
|
|
||||||
public abstract void setGap(YogaGutter gutter, float gapLength);
|
public abstract void setGap(YogaGutter gutter, float gapLength);
|
||||||
|
|
||||||
|
@@ -811,8 +811,8 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public YogaValue getGap(YogaGutter gutter) {
|
public float getGap(YogaGutter gutter) {
|
||||||
return valueFromLong(YogaNative.jni_YGNodeStyleGetGapJNI(mNativePointer, gutter.intValue()));
|
return YogaNative.jni_YGNodeStyleGetGapJNI(mNativePointer, gutter.intValue());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@@ -725,13 +725,13 @@ jni_YGNodeCloneJNI(JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer) {
|
|||||||
return reinterpret_cast<jlong>(clonedYogaNode);
|
return reinterpret_cast<jlong>(clonedYogaNode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static jlong jni_YGNodeStyleGetGapJNI(
|
static jfloat jni_YGNodeStyleGetGapJNI(
|
||||||
JNIEnv* /*env*/,
|
JNIEnv* /*env*/,
|
||||||
jobject /*obj*/,
|
jobject /*obj*/,
|
||||||
jlong nativePointer,
|
jlong nativePointer,
|
||||||
jint gutter) {
|
jint gutter) {
|
||||||
return YogaValue::asJavaLong(YGNodeStyleGetGap(
|
return (jfloat)YGNodeStyleGetGap(
|
||||||
_jlong2YGNodeRef(nativePointer), static_cast<YGGutter>(gutter)));
|
_jlong2YGNodeRef(nativePointer), static_cast<YGGutter>(gutter));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void jni_YGNodeStyleSetGapJNI(
|
static void jni_YGNodeStyleSetGapJNI(
|
||||||
@@ -1057,7 +1057,7 @@ static JNINativeMethod methods[] = {
|
|||||||
{"jni_YGNodeSetHasMeasureFuncJNI",
|
{"jni_YGNodeSetHasMeasureFuncJNI",
|
||||||
"(JZ)V",
|
"(JZ)V",
|
||||||
(void*)jni_YGNodeSetHasMeasureFuncJNI},
|
(void*)jni_YGNodeSetHasMeasureFuncJNI},
|
||||||
{"jni_YGNodeStyleGetGapJNI", "(JI)J", (void*)jni_YGNodeStyleGetGapJNI},
|
{"jni_YGNodeStyleGetGapJNI", "(JI)F", (void*)jni_YGNodeStyleGetGapJNI},
|
||||||
{"jni_YGNodeStyleSetGapJNI", "(JIF)V", (void*)jni_YGNodeStyleSetGapJNI},
|
{"jni_YGNodeStyleSetGapJNI", "(JIF)V", (void*)jni_YGNodeStyleSetGapJNI},
|
||||||
{"jni_YGNodeStyleSetGapPercentJNI",
|
{"jni_YGNodeStyleSetGapPercentJNI",
|
||||||
"(JIF)V",
|
"(JIF)V",
|
||||||
|
@@ -11,7 +11,6 @@ import com.facebook.yoga.YogaMeasureMode;
|
|||||||
import com.facebook.yoga.YogaMeasureOutput;
|
import com.facebook.yoga.YogaMeasureOutput;
|
||||||
import com.facebook.yoga.YogaMeasureFunction;
|
import com.facebook.yoga.YogaMeasureFunction;
|
||||||
import com.facebook.yoga.YogaNode;
|
import com.facebook.yoga.YogaNode;
|
||||||
import com.facebook.yoga.YogaFlexDirection;
|
|
||||||
|
|
||||||
public class TestUtils {
|
public class TestUtils {
|
||||||
|
|
||||||
@@ -44,13 +43,9 @@ public class TestUtils {
|
|||||||
} else if (heightMode == YogaMeasureMode.AT_MOST) {
|
} else if (heightMode == YogaMeasureMode.AT_MOST) {
|
||||||
measuredHeight =
|
measuredHeight =
|
||||||
Math.min(
|
Math.min(
|
||||||
caclulateHeight(text, node.getFlexDirection() == YogaFlexDirection.COLUMN
|
caclulateHeight(text, Math.max(measuredWidth, getWidestWordWidth(text))), height);
|
||||||
? measuredWidth
|
|
||||||
: Math.max(measuredWidth, getWidestWordWidth(text))), height);
|
|
||||||
} else {
|
} else {
|
||||||
measuredHeight = caclulateHeight(text, node.getFlexDirection() == YogaFlexDirection.COLUMN
|
measuredHeight = caclulateHeight(text, Math.max(measuredWidth, getWidestWordWidth(text)));
|
||||||
? measuredWidth
|
|
||||||
: Math.max(measuredWidth, getWidestWordWidth(text)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return YogaMeasureOutput.make(measuredWidth, measuredHeight);
|
return YogaMeasureOutput.make(measuredWidth, measuredHeight);
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -439,9 +439,8 @@ Value Node::getPadding(int edge) const {
|
|||||||
YGNodeStyleGetPadding(m_node, static_cast<YGEdge>(edge)));
|
YGNodeStyleGetPadding(m_node, static_cast<YGEdge>(edge)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Value Node::getGap(int gutter) const {
|
float Node::getGap(int gutter) {
|
||||||
return Value::fromYGValue(
|
return YGNodeStyleGetGap(m_node, static_cast<YGGutter>(gutter));
|
||||||
YGNodeStyleGetGap(m_node, static_cast<YGGutter>(gutter)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Node::isReferenceBaseline() {
|
bool Node::isReferenceBaseline() {
|
||||||
|
@@ -186,7 +186,7 @@ class Node {
|
|||||||
|
|
||||||
Value getPadding(int edge) const;
|
Value getPadding(int edge) const;
|
||||||
|
|
||||||
Value getGap(int gutter) const;
|
float getGap(int gutter);
|
||||||
|
|
||||||
int getBoxSizing(void) const;
|
int getBoxSizing(void) const;
|
||||||
|
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -5,23 +5,17 @@
|
|||||||
* LICENSE file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import {FlexDirection, MeasureMode} from 'yoga-layout';
|
import {MeasureMode} from 'yoga-layout';
|
||||||
|
|
||||||
type MeasureContext = {
|
|
||||||
text: string;
|
|
||||||
flexDirection: FlexDirection;
|
|
||||||
};
|
|
||||||
|
|
||||||
export function instrinsicSizeMeasureFunc(
|
export function instrinsicSizeMeasureFunc(
|
||||||
this: MeasureContext,
|
this: string,
|
||||||
width: number,
|
width: number,
|
||||||
widthMode: MeasureMode,
|
widthMode: MeasureMode,
|
||||||
height: number,
|
height: number,
|
||||||
heightMode: MeasureMode,
|
heightMode: MeasureMode,
|
||||||
): {width: number; height: number} {
|
): {width: number; height: number} {
|
||||||
const textLength = this.text.length;
|
const textLength = this.length;
|
||||||
const words = this.text.split(' ');
|
const words = this.split(' ');
|
||||||
const flexDirection = this.flexDirection;
|
|
||||||
const widthPerChar = 10;
|
const widthPerChar = 10;
|
||||||
const heightPerChar = 10;
|
const heightPerChar = 10;
|
||||||
|
|
||||||
@@ -59,10 +53,7 @@ export function instrinsicSizeMeasureFunc(
|
|||||||
return heightPerChar;
|
return heightPerChar;
|
||||||
}
|
}
|
||||||
|
|
||||||
const maxLineWidth =
|
const maxLineWidth = Math.max(longestWordWidth(), measuredWidth);
|
||||||
flexDirection == FlexDirection.Column
|
|
||||||
? measuredWidth
|
|
||||||
: Math.max(longestWordWidth(), measuredWidth);
|
|
||||||
|
|
||||||
//if fixed width < width of widest word, take width of widest word
|
//if fixed width < width of widest word, take width of widest word
|
||||||
|
|
||||||
|
@@ -8,8 +8,6 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <yoga/Yoga.h>
|
#include <yoga/Yoga.h>
|
||||||
|
|
||||||
#include <cmath>
|
|
||||||
|
|
||||||
TEST(YogaTest, rounding_value) {
|
TEST(YogaTest, rounding_value) {
|
||||||
// Test that whole numbers are rounded to whole despite ceil/floor flags
|
// Test that whole numbers are rounded to whole despite ceil/floor flags
|
||||||
ASSERT_FLOAT_EQ(6.0, YGRoundValueToPixelGrid(6.000001, 2.0, false, false));
|
ASSERT_FLOAT_EQ(6.0, YGRoundValueToPixelGrid(6.000001, 2.0, false, false));
|
||||||
@@ -41,44 +39,6 @@ TEST(YogaTest, rounding_value) {
|
|||||||
ASSERT_FLOAT_EQ(-6.0, YGRoundValueToPixelGrid(-5.99, 2.0, false, false));
|
ASSERT_FLOAT_EQ(-6.0, YGRoundValueToPixelGrid(-5.99, 2.0, false, false));
|
||||||
ASSERT_FLOAT_EQ(-5.5, YGRoundValueToPixelGrid(-5.99, 2.0, true, false));
|
ASSERT_FLOAT_EQ(-5.5, YGRoundValueToPixelGrid(-5.99, 2.0, true, false));
|
||||||
ASSERT_FLOAT_EQ(-6.0, YGRoundValueToPixelGrid(-5.99, 2.0, false, true));
|
ASSERT_FLOAT_EQ(-6.0, YGRoundValueToPixelGrid(-5.99, 2.0, false, true));
|
||||||
|
|
||||||
// Rounding up/down halfway values is as expected for both positive and
|
|
||||||
// negative numbers
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.5, 1.0, false, false));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.4, 1.0, false, false));
|
|
||||||
ASSERT_FLOAT_EQ(-4, YGRoundValueToPixelGrid(-3.6, 1.0, false, false));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.499999, 1.0, false, false));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.500001, 1.0, false, false));
|
|
||||||
ASSERT_FLOAT_EQ(-4, YGRoundValueToPixelGrid(-3.5001, 1.0, false, false));
|
|
||||||
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.5, 1.0, true, false));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.4, 1.0, true, false));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.6, 1.0, true, false));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.499999, 1.0, true, false));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.500001, 1.0, true, false));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.5001, 1.0, true, false));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.00001, 1.0, true, false));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3, 1.0, true, false));
|
|
||||||
|
|
||||||
ASSERT_FLOAT_EQ(-4, YGRoundValueToPixelGrid(-3.5, 1.0, false, true));
|
|
||||||
ASSERT_FLOAT_EQ(-4, YGRoundValueToPixelGrid(-3.4, 1.0, false, true));
|
|
||||||
ASSERT_FLOAT_EQ(-4, YGRoundValueToPixelGrid(-3.6, 1.0, false, true));
|
|
||||||
ASSERT_FLOAT_EQ(-4, YGRoundValueToPixelGrid(-3.499999, 1.0, false, true));
|
|
||||||
ASSERT_FLOAT_EQ(-4, YGRoundValueToPixelGrid(-3.500001, 1.0, false, true));
|
|
||||||
ASSERT_FLOAT_EQ(-4, YGRoundValueToPixelGrid(-3.5001, 1.0, false, true));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3.00001, 1.0, false, true));
|
|
||||||
ASSERT_FLOAT_EQ(-3, YGRoundValueToPixelGrid(-3, 1.0, false, true));
|
|
||||||
|
|
||||||
// NAN is treated as expected:
|
|
||||||
ASSERT_TRUE(std::isnan(YGRoundValueToPixelGrid(
|
|
||||||
std::numeric_limits<double>::quiet_NaN(), 1.5, false, false)));
|
|
||||||
ASSERT_TRUE(std::isnan(YGRoundValueToPixelGrid(
|
|
||||||
1.5, std::numeric_limits<double>::quiet_NaN(), false, false)));
|
|
||||||
ASSERT_TRUE(std::isnan(YGRoundValueToPixelGrid(
|
|
||||||
std::numeric_limits<double>::quiet_NaN(),
|
|
||||||
std::numeric_limits<double>::quiet_NaN(),
|
|
||||||
false,
|
|
||||||
false)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static YGSize measureText(
|
static YGSize measureText(
|
||||||
|
File diff suppressed because it is too large
Load Diff
@@ -90,20 +90,14 @@ YGSize IntrinsicSizeMeasure(
|
|||||||
measuredHeight = std::min(
|
measuredHeight = std::min(
|
||||||
calculateHeight(
|
calculateHeight(
|
||||||
innerText,
|
innerText,
|
||||||
YGNodeStyleGetFlexDirection(node) == YGFlexDirectionColumn
|
std::max(longestWordWidth(innerText, widthPerChar), measuredWidth),
|
||||||
? measuredWidth
|
|
||||||
: std::max(
|
|
||||||
longestWordWidth(innerText, widthPerChar), measuredWidth),
|
|
||||||
widthPerChar,
|
widthPerChar,
|
||||||
heightPerChar),
|
heightPerChar),
|
||||||
height);
|
height);
|
||||||
} else {
|
} else {
|
||||||
measuredHeight = calculateHeight(
|
measuredHeight = calculateHeight(
|
||||||
innerText,
|
innerText,
|
||||||
YGNodeStyleGetFlexDirection(node) == YGFlexDirectionColumn
|
std::max(longestWordWidth(innerText, widthPerChar), measuredWidth),
|
||||||
? measuredWidth
|
|
||||||
: std::max(
|
|
||||||
longestWordWidth(innerText, widthPerChar), measuredWidth),
|
|
||||||
widthPerChar,
|
widthPerChar,
|
||||||
heightPerChar);
|
heightPerChar);
|
||||||
}
|
}
|
||||||
|
@@ -1,83 +0,0 @@
|
|||||||
---
|
|
||||||
slug: announcing-yoga-3.2
|
|
||||||
title: Announcing Yoga 3.2
|
|
||||||
authors:
|
|
||||||
- NickGerleman
|
|
||||||
---
|
|
||||||
|
|
||||||
import Playground from '@site/src/components/Playground';
|
|
||||||
|
|
||||||
Yoga 3.2 is a new minor version of Yoga, used by React Native 0.77.
|
|
||||||
|
|
||||||
## Highlights
|
|
||||||
|
|
||||||
1. Support for `box-sizing`
|
|
||||||
2. Support for `display: contents`
|
|
||||||
3. Bug fixes and improvements
|
|
||||||
|
|
||||||
## `box-sizing`
|
|
||||||
|
|
||||||
Yoga [now supports](https://github.com/facebook/yoga/commit/671ae61a39d02091d1e73fe773d6a09f2f93cda4) [`box-sizing`](https://developer.mozilla.org/en-US/docs/Web/CSS/box-sizing) on styles, allowing sizing values to influence the content box instead of the border box.
|
|
||||||
|
|
||||||
:::warning
|
|
||||||
|
|
||||||
To preserve compatibility, Yoga nodes default to `box-sizing: border-box`, even if `UseWebDefaults` is set. We recommend manually setting node defaults instead of using the `UseWebDefaults` API.
|
|
||||||
|
|
||||||
:::
|
|
||||||
|
|
||||||
<Playground code={`<Layout config={{useWebDefaults: true}}>
|
|
||||||
<Node
|
|
||||||
style={{
|
|
||||||
width: 100,
|
|
||||||
height: 100,
|
|
||||||
padding: 50,
|
|
||||||
boxSizing: "border-box",
|
|
||||||
}}>
|
|
||||||
</Node>
|
|
||||||
</Layout>`} />
|
|
||||||
|
|
||||||
<Playground code={`<Layout config={{useWebDefaults: true}}>
|
|
||||||
<Node
|
|
||||||
style={{
|
|
||||||
width: 100,
|
|
||||||
height: 100,
|
|
||||||
padding: 50,
|
|
||||||
boxSizing: "content-box",
|
|
||||||
}}>
|
|
||||||
</Node>
|
|
||||||
</Layout>`} />
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## `display: contents`
|
|
||||||
|
|
||||||
Yoga nodes [may now be set to `display: contents`](https://github.com/facebook/yoga/commit/68bb2343d2b470962065789d09016bba8e785340) to remove them from the layout flow, while preserving and hoisting the node's children. This may be used by the higher level UI framework to allow more easily composing wrapper components (such as those which may need to handle events, without influencing child layout). Thanks [@j-piasecki](https://github.com/j-piasecki) for the contribution!
|
|
||||||
|
|
||||||
<Playground code={`<Layout config={{useWebDefaults: false}}>
|
|
||||||
<Node
|
|
||||||
style={{
|
|
||||||
width: 100,
|
|
||||||
height: 100,
|
|
||||||
gap: 10,
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<Node style={{display: "contents"}}>
|
|
||||||
<Node style={{flexGrow: 1}} />
|
|
||||||
<Node style={{flexGrow: 1}} />
|
|
||||||
<Node style={{flexGrow: 1}} />
|
|
||||||
</Node>
|
|
||||||
</Node>
|
|
||||||
</Layout>`} />
|
|
||||||
|
|
||||||
|
|
||||||
## Removal of legacy absolute positioning
|
|
||||||
|
|
||||||
Yoga 3.0 introduced a new algorithm used for absolute positioning. This algorithm is more correct than the one previously used, but led to observed compatibility issues with existing code, so we left the option to disable it via the `AbsolutePositioningIncorrect` erratum (enabled by default in frameworks like React Native). Yoga 3.2 removes the legacy absolute positioning path, but ports over the main compatibility quirk under a new erratum `AbsolutePositionWithoutInsetsExcludesPadding` (where the previous incorrect behavior would omit padding when a position was not specified on the absolute node). Errata users should see more correct absolute positioning behavior, while preserving compatibility with existing code.
|
|
||||||
|
|
||||||
## Fixed non-global YogaConfig in Java bindings
|
|
||||||
|
|
||||||
Yoga would previously allow garbage collection of a `YogaConfig` if it was not retained outside of the Yoga tree. This could result in confusing errors caused by use-after free. Yoga nodes [now correctly retain the configs they are using](https://github.com/facebook/yoga/commit/22b018c957e930de950338ad87f4ef8d59e8a169). Thanks [@michaeltroger](https://github.com/michaeltroger) for this fix!
|
|
||||||
|
|
||||||
## Fixed behavior when combining `align-items` with `align-content`
|
|
||||||
|
|
||||||
A regression [was fixed](https://github.com/facebook/yoga/commit/77c99870127e9c2d46a07264fa372025334d8fd0) in how Yoga handles some combinations of `align-content` and `align-items`. Thanks [@phuccvx12](https://github.com/phuccvx12) for this fix!
|
|
@@ -63,7 +63,7 @@ export type FlexStyle = {
|
|||||||
bottom?: number | `${number}%`;
|
bottom?: number | `${number}%`;
|
||||||
boxSizing?: 'border-box' | 'content-box';
|
boxSizing?: 'border-box' | 'content-box';
|
||||||
direction?: 'ltr' | 'rtl';
|
direction?: 'ltr' | 'rtl';
|
||||||
display?: 'none' | 'flex' | 'contents';
|
display?: 'none' | 'flex';
|
||||||
end?: number | `${number}%`;
|
end?: number | `${number}%`;
|
||||||
flex?: number;
|
flex?: number;
|
||||||
flexBasis?: number | 'auto' | `${number}%`;
|
flexBasis?: number | 'auto' | `${number}%`;
|
||||||
@@ -360,14 +360,12 @@ function direction(str?: 'ltr' | 'rtl'): Direction {
|
|||||||
throw new Error(`"${str}" is not a valid value for direction`);
|
throw new Error(`"${str}" is not a valid value for direction`);
|
||||||
}
|
}
|
||||||
|
|
||||||
function display(str?: 'none' | 'flex' | 'contents'): Display {
|
function display(str?: 'none' | 'flex'): Display {
|
||||||
switch (str) {
|
switch (str) {
|
||||||
case 'none':
|
case 'none':
|
||||||
return Display.None;
|
return Display.None;
|
||||||
case 'flex':
|
case 'flex':
|
||||||
return Display.Flex;
|
return Display.Flex;
|
||||||
case 'contents':
|
|
||||||
return Display.Contents;
|
|
||||||
}
|
}
|
||||||
throw new Error(`"${str}" is not a valid value for display`);
|
throw new Error(`"${str}" is not a valid value for display`);
|
||||||
}
|
}
|
||||||
|
@@ -16,7 +16,6 @@ export type LayoutMetrics = {
|
|||||||
width: number;
|
width: number;
|
||||||
height: number;
|
height: number;
|
||||||
overflow?: 'visible' | 'hidden' | 'scroll';
|
overflow?: 'visible' | 'hidden' | 'scroll';
|
||||||
display?: 'flex' | 'none' | 'contents';
|
|
||||||
children?: LayoutMetrics[];
|
children?: LayoutMetrics[];
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -50,11 +49,7 @@ export default function LayoutBox({metrics, depth, className}: Props) {
|
|||||||
position: depth === 0 ? 'relative' : 'absolute',
|
position: depth === 0 ? 'relative' : 'absolute',
|
||||||
}}>
|
}}>
|
||||||
{children?.map((child, i) => (
|
{children?.map((child, i) => (
|
||||||
<LayoutBox
|
<LayoutBox key={i} metrics={child} depth={depth + 1} />
|
||||||
key={i}
|
|
||||||
metrics={child}
|
|
||||||
depth={style.display === 'contents' ? depth : depth + 1}
|
|
||||||
/>
|
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@@ -8,12 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import {useMemo} from 'react';
|
import {useMemo} from 'react';
|
||||||
import Yoga, {
|
import Yoga, {Direction, Overflow, Node as YogaNode} from 'yoga-layout';
|
||||||
Direction,
|
|
||||||
Display,
|
|
||||||
Overflow,
|
|
||||||
Node as YogaNode,
|
|
||||||
} from 'yoga-layout';
|
|
||||||
import {FlexStyle, applyStyle} from './FlexStyle';
|
import {FlexStyle, applyStyle} from './FlexStyle';
|
||||||
import LayoutBox from './LayoutBox';
|
import LayoutBox from './LayoutBox';
|
||||||
|
|
||||||
@@ -114,16 +109,6 @@ function metricsFromYogaNode(node: YogaNode): LayoutMetrics {
|
|||||||
return 'visible';
|
return 'visible';
|
||||||
}
|
}
|
||||||
})(),
|
})(),
|
||||||
display: (() => {
|
|
||||||
switch (node.getDisplay()) {
|
|
||||||
case Display.Flex:
|
|
||||||
return 'flex';
|
|
||||||
case Display.None:
|
|
||||||
return 'none';
|
|
||||||
case Display.Contents:
|
|
||||||
return 'contents';
|
|
||||||
}
|
|
||||||
})(),
|
|
||||||
children,
|
children,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
37
yarn.lock
37
yarn.lock
@@ -5984,9 +5984,9 @@ http-parser-js@>=0.5.1:
|
|||||||
integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==
|
integrity sha512-SGeBX54F94Wgu5RH3X5jsDtf4eHyRogWX1XGT3b4HuW3tQPM4AaBzoUji/4AAJNXCEOWZ5O0DgZmJw1947gD5Q==
|
||||||
|
|
||||||
http-proxy-middleware@^2.0.3:
|
http-proxy-middleware@^2.0.3:
|
||||||
version "2.0.6"
|
version "2.0.7"
|
||||||
resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.6.tgz#e1a4dd6979572c7ab5a4e4b55095d1f32a74963f"
|
resolved "https://registry.yarnpkg.com/http-proxy-middleware/-/http-proxy-middleware-2.0.7.tgz#915f236d92ae98ef48278a95dedf17e991936ec6"
|
||||||
integrity sha512-ya/UeJ6HVBYxrgYotAZo1KvPWlgB48kUJLDePFeneHsVujFaW5WNj2NgWCAE//B1Dl02BIfYlpNgBy8Kf8Rjmw==
|
integrity sha512-fgVY8AV7qU7z/MmXJ/rxwbrtQH4jBQ9m7kp3llF0liB7glmFeVZFBepQb32T3y8n8k2+AEYuMPCpinYW+/CuRA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@types/http-proxy" "^1.17.8"
|
"@types/http-proxy" "^1.17.8"
|
||||||
http-proxy "^1.18.1"
|
http-proxy "^1.18.1"
|
||||||
@@ -10173,7 +10173,16 @@ string-length@^4.0.1:
|
|||||||
char-regex "^1.0.2"
|
char-regex "^1.0.2"
|
||||||
strip-ansi "^6.0.0"
|
strip-ansi "^6.0.0"
|
||||||
|
|
||||||
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
"string-width-cjs@npm:string-width@^4.2.0":
|
||||||
|
version "4.2.3"
|
||||||
|
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||||
|
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||||
|
dependencies:
|
||||||
|
emoji-regex "^8.0.0"
|
||||||
|
is-fullwidth-code-point "^3.0.0"
|
||||||
|
strip-ansi "^6.0.1"
|
||||||
|
|
||||||
|
string-width@^4.1.0, string-width@^4.2.0, string-width@^4.2.3:
|
||||||
version "4.2.3"
|
version "4.2.3"
|
||||||
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
|
||||||
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
|
||||||
@@ -10264,7 +10273,14 @@ stringify-object@^3.3.0:
|
|||||||
is-obj "^1.0.1"
|
is-obj "^1.0.1"
|
||||||
is-regexp "^1.0.0"
|
is-regexp "^1.0.0"
|
||||||
|
|
||||||
"strip-ansi-cjs@npm:strip-ansi@^6.0.1", strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
"strip-ansi-cjs@npm:strip-ansi@^6.0.1":
|
||||||
|
version "6.0.1"
|
||||||
|
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||||
|
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||||
|
dependencies:
|
||||||
|
ansi-regex "^5.0.1"
|
||||||
|
|
||||||
|
strip-ansi@^6.0.0, strip-ansi@^6.0.1:
|
||||||
version "6.0.1"
|
version "6.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
|
||||||
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
|
||||||
@@ -11164,7 +11180,16 @@ word-wrap@^1.2.3:
|
|||||||
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
|
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.5.tgz#d2c45c6dd4fbce621a66f136cbe328afd0410b34"
|
||||||
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==
|
integrity sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==
|
||||||
|
|
||||||
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0", wrap-ansi@7.0.0, wrap-ansi@^7.0.0:
|
"wrap-ansi-cjs@npm:wrap-ansi@^7.0.0":
|
||||||
|
version "7.0.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||||
|
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||||
|
dependencies:
|
||||||
|
ansi-styles "^4.0.0"
|
||||||
|
string-width "^4.1.0"
|
||||||
|
strip-ansi "^6.0.0"
|
||||||
|
|
||||||
|
wrap-ansi@7.0.0, wrap-ansi@^7.0.0:
|
||||||
version "7.0.0"
|
version "7.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
resolved "https://registry.yarnpkg.com/wrap-ansi/-/wrap-ansi-7.0.0.tgz#67e145cff510a6a6984bdf1152911d69d2eb9e43"
|
||||||
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
integrity sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==
|
||||||
|
@@ -293,8 +293,13 @@ void YGNodeStyleSetGapPercent(YGNodeRef node, YGGutter gutter, float percent) {
|
|||||||
node, scopedEnum(gutter), StyleLength::percent(percent));
|
node, scopedEnum(gutter), StyleLength::percent(percent));
|
||||||
}
|
}
|
||||||
|
|
||||||
YGValue YGNodeStyleGetGap(const YGNodeConstRef node, const YGGutter gutter) {
|
float YGNodeStyleGetGap(const YGNodeConstRef node, const YGGutter gutter) {
|
||||||
return (YGValue)resolveRef(node)->style().gap(scopedEnum(gutter));
|
auto gapLength = resolveRef(node)->style().gap(scopedEnum(gutter));
|
||||||
|
if (gapLength.isUndefined() || gapLength.isAuto()) {
|
||||||
|
return YGUndefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
return static_cast<YGValue>(gapLength).value;
|
||||||
}
|
}
|
||||||
|
|
||||||
void YGNodeStyleSetAspectRatio(const YGNodeRef node, const float aspectRatio) {
|
void YGNodeStyleSetAspectRatio(const YGNodeRef node, const float aspectRatio) {
|
||||||
|
@@ -96,7 +96,7 @@ YG_EXPORT void
|
|||||||
YGNodeStyleSetGap(YGNodeRef node, YGGutter gutter, float gapLength);
|
YGNodeStyleSetGap(YGNodeRef node, YGGutter gutter, float gapLength);
|
||||||
YG_EXPORT void
|
YG_EXPORT void
|
||||||
YGNodeStyleSetGapPercent(YGNodeRef node, YGGutter gutter, float gapLength);
|
YGNodeStyleSetGapPercent(YGNodeRef node, YGGutter gutter, float gapLength);
|
||||||
YG_EXPORT YGValue YGNodeStyleGetGap(YGNodeConstRef node, YGGutter gutter);
|
YG_EXPORT float YGNodeStyleGetGap(YGNodeConstRef node, YGGutter gutter);
|
||||||
|
|
||||||
YG_EXPORT void YGNodeStyleSetBoxSizing(YGNodeRef node, YGBoxSizing boxSizing);
|
YG_EXPORT void YGNodeStyleSetBoxSizing(YGNodeRef node, YGBoxSizing boxSizing);
|
||||||
YG_EXPORT YGBoxSizing YGNodeStyleGetBoxSizing(YGNodeConstRef node);
|
YG_EXPORT YGBoxSizing YGNodeStyleGetBoxSizing(YGNodeConstRef node);
|
||||||
|
@@ -1213,10 +1213,10 @@ static void calculateLayoutImpl(
|
|||||||
const float ownerWidth,
|
const float ownerWidth,
|
||||||
const float ownerHeight,
|
const float ownerHeight,
|
||||||
const bool performLayout,
|
const bool performLayout,
|
||||||
const LayoutPassReason reason,
|
|
||||||
LayoutData& layoutMarkerData,
|
LayoutData& layoutMarkerData,
|
||||||
const uint32_t depth,
|
const uint32_t depth,
|
||||||
const uint32_t generationCount) {
|
const uint32_t generationCount,
|
||||||
|
const LayoutPassReason reason) {
|
||||||
yoga::assertFatalWithNode(
|
yoga::assertFatalWithNode(
|
||||||
node,
|
node,
|
||||||
yoga::isUndefined(availableWidth)
|
yoga::isUndefined(availableWidth)
|
||||||
@@ -1780,7 +1780,7 @@ static void calculateLayoutImpl(
|
|||||||
crossAxis,
|
crossAxis,
|
||||||
direction,
|
direction,
|
||||||
unclampedCrossDim,
|
unclampedCrossDim,
|
||||||
crossAxisOwnerSize,
|
ownerHeight,
|
||||||
ownerWidth) -
|
ownerWidth) -
|
||||||
paddingAndBorderAxisCross;
|
paddingAndBorderAxisCross;
|
||||||
|
|
||||||
@@ -2268,10 +2268,10 @@ bool calculateLayoutInternal(
|
|||||||
ownerWidth,
|
ownerWidth,
|
||||||
ownerHeight,
|
ownerHeight,
|
||||||
performLayout,
|
performLayout,
|
||||||
reason,
|
|
||||||
layoutMarkerData,
|
layoutMarkerData,
|
||||||
depth,
|
depth,
|
||||||
generationCount);
|
generationCount,
|
||||||
|
reason);
|
||||||
|
|
||||||
layout->lastOwnerDirection = ownerDirection;
|
layout->lastOwnerDirection = ownerDirection;
|
||||||
layout->configVersion = node->getConfig()->getVersion();
|
layout->configVersion = node->getConfig()->getVersion();
|
||||||
|
@@ -17,7 +17,7 @@ FlexLine calculateFlexLine(
|
|||||||
yoga::Node* const node,
|
yoga::Node* const node,
|
||||||
const Direction ownerDirection,
|
const Direction ownerDirection,
|
||||||
const float ownerWidth,
|
const float ownerWidth,
|
||||||
const float mainAxisOwnerSize,
|
const float mainAxisownerSize,
|
||||||
const float availableInnerWidth,
|
const float availableInnerWidth,
|
||||||
const float availableInnerMainDim,
|
const float availableInnerMainDim,
|
||||||
Node::LayoutableChildren::Iterator& iterator,
|
Node::LayoutableChildren::Iterator& iterator,
|
||||||
@@ -70,7 +70,7 @@ FlexLine calculateFlexLine(
|
|||||||
direction,
|
direction,
|
||||||
mainAxis,
|
mainAxis,
|
||||||
child->getLayout().computedFlexBasis,
|
child->getLayout().computedFlexBasis,
|
||||||
mainAxisOwnerSize,
|
mainAxisownerSize,
|
||||||
ownerWidth)
|
ownerWidth)
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
|
@@ -66,7 +66,7 @@ FlexLine calculateFlexLine(
|
|||||||
yoga::Node* node,
|
yoga::Node* node,
|
||||||
Direction ownerDirection,
|
Direction ownerDirection,
|
||||||
float ownerWidth,
|
float ownerWidth,
|
||||||
float mainAxisOwnerSize,
|
float mainAxisownerSize,
|
||||||
float availableInnerWidth,
|
float availableInnerWidth,
|
||||||
float availableInnerMainDim,
|
float availableInnerMainDim,
|
||||||
Node::LayoutableChildren::Iterator& iterator,
|
Node::LayoutableChildren::Iterator& iterator,
|
||||||
|
@@ -66,8 +66,7 @@ void roundLayoutResultsToPixelGrid(
|
|||||||
yoga::Node* const node,
|
yoga::Node* const node,
|
||||||
const double absoluteLeft,
|
const double absoluteLeft,
|
||||||
const double absoluteTop) {
|
const double absoluteTop) {
|
||||||
const auto pointScaleFactor =
|
const auto pointScaleFactor = node->getConfig()->getPointScaleFactor();
|
||||||
static_cast<double>(node->getConfig()->getPointScaleFactor());
|
|
||||||
|
|
||||||
const double nodeLeft = node->getLayout().position(PhysicalEdge::Left);
|
const double nodeLeft = node->getLayout().position(PhysicalEdge::Left);
|
||||||
const double nodeTop = node->getLayout().position(PhysicalEdge::Top);
|
const double nodeTop = node->getLayout().position(PhysicalEdge::Top);
|
||||||
@@ -81,7 +80,7 @@ void roundLayoutResultsToPixelGrid(
|
|||||||
const double absoluteNodeRight = absoluteNodeLeft + nodeWidth;
|
const double absoluteNodeRight = absoluteNodeLeft + nodeWidth;
|
||||||
const double absoluteNodeBottom = absoluteNodeTop + nodeHeight;
|
const double absoluteNodeBottom = absoluteNodeTop + nodeHeight;
|
||||||
|
|
||||||
if (pointScaleFactor != 0.0) {
|
if (pointScaleFactor != 0.0f) {
|
||||||
// If a node has a custom measure function we never want to round down its
|
// If a node has a custom measure function we never want to round down its
|
||||||
// size as this could lead to unwanted text truncation.
|
// size as this could lead to unwanted text truncation.
|
||||||
const bool textRounding = node->getNodeType() == NodeType::Text;
|
const bool textRounding = node->getNodeType() == NodeType::Text;
|
||||||
@@ -97,14 +96,12 @@ void roundLayoutResultsToPixelGrid(
|
|||||||
// We multiply dimension by scale factor and if the result is close to the
|
// We multiply dimension by scale factor and if the result is close to the
|
||||||
// whole number, we don't have any fraction To verify if the result is close
|
// whole number, we don't have any fraction To verify if the result is close
|
||||||
// to whole number we want to check both floor and ceil numbers
|
// to whole number we want to check both floor and ceil numbers
|
||||||
|
|
||||||
const double scaledNodeWith = nodeWidth * pointScaleFactor;
|
|
||||||
const bool hasFractionalWidth =
|
const bool hasFractionalWidth =
|
||||||
!yoga::inexactEquals(round(scaledNodeWith), scaledNodeWith);
|
!yoga::inexactEquals(fmod(nodeWidth * pointScaleFactor, 1.0), 0) &&
|
||||||
|
!yoga::inexactEquals(fmod(nodeWidth * pointScaleFactor, 1.0), 1.0);
|
||||||
const double scaledNodeHeight = nodeHeight * pointScaleFactor;
|
|
||||||
const bool hasFractionalHeight =
|
const bool hasFractionalHeight =
|
||||||
!yoga::inexactEquals(round(scaledNodeHeight), scaledNodeHeight);
|
!yoga::inexactEquals(fmod(nodeHeight * pointScaleFactor, 1.0), 0) &&
|
||||||
|
!yoga::inexactEquals(fmod(nodeHeight * pointScaleFactor, 1.0), 1.0);
|
||||||
|
|
||||||
node->setLayoutDimension(
|
node->setLayoutDimension(
|
||||||
roundValueToPixelGrid(
|
roundValueToPixelGrid(
|
||||||
|
@@ -245,8 +245,8 @@ void Node::setLayoutHadOverflow(bool hadOverflow) {
|
|||||||
layout_.setHadOverflow(hadOverflow);
|
layout_.setHadOverflow(hadOverflow);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Node::setLayoutDimension(float lengthValue, Dimension dimension) {
|
void Node::setLayoutDimension(float LengthValue, Dimension dimension) {
|
||||||
layout_.setDimension(dimension, lengthValue);
|
layout_.setDimension(dimension, LengthValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If both left and right are defined, then use left. Otherwise return +left or
|
// If both left and right are defined, then use left. Otherwise return +left or
|
||||||
|
@@ -259,7 +259,7 @@ class YG_EXPORT Node : public ::YGNode {
|
|||||||
uint32_t computedFlexBasisGeneration);
|
uint32_t computedFlexBasisGeneration);
|
||||||
void setLayoutMeasuredDimension(float measuredDimension, Dimension dimension);
|
void setLayoutMeasuredDimension(float measuredDimension, Dimension dimension);
|
||||||
void setLayoutHadOverflow(bool hadOverflow);
|
void setLayoutHadOverflow(bool hadOverflow);
|
||||||
void setLayoutDimension(float lengthValue, Dimension dimension);
|
void setLayoutDimension(float LengthValue, Dimension dimension);
|
||||||
void setLayoutDirection(Direction direction);
|
void setLayoutDirection(Direction direction);
|
||||||
void setLayoutMargin(float margin, PhysicalEdge edge);
|
void setLayoutMargin(float margin, PhysicalEdge edge);
|
||||||
void setLayoutBorder(float border, PhysicalEdge edge);
|
void setLayoutBorder(float border, PhysicalEdge edge);
|
||||||
|
Reference in New Issue
Block a user