Compare commits
276 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
e9e2ae28e0 | ||
|
4ed3dd4b82 | ||
|
a7f430a5ef | ||
|
89ba4f282d | ||
|
b6231ee0ed | ||
|
e384002878 | ||
|
9ceed4b601 | ||
|
765bb85d1e | ||
|
6548dddec3 | ||
|
966f5ece4a | ||
|
ede2888326 | ||
|
2eda444bbf | ||
|
7c4319181b | ||
|
f4d29e6f11 | ||
|
77ea79490f | ||
|
46c96ee2cb | ||
|
a67c555320 | ||
|
cdb1ee21a0 | ||
|
2ce219ef42 | ||
|
c5f826de83 | ||
|
526ca42d04 | ||
|
b47f0ce41a | ||
|
eb7cb11ffd | ||
|
f9df990177 | ||
|
684dccb7b9 | ||
|
6c51eb4f72 | ||
|
ca485dfb50 | ||
|
50e3714b21 | ||
|
c52c7cdd1e | ||
|
11200f3d75 | ||
|
5dbe3c128b | ||
|
3564ccf6e4 | ||
|
e1c19cecad | ||
|
8e4f3a3084 | ||
|
9b8323ff38 | ||
|
5b7adda620 | ||
|
ba2a3b8c91 | ||
|
eb15939c23 | ||
|
b9fa60fd74 | ||
|
d397aa04d7 | ||
|
adb1b11055 | ||
|
2e234473ca | ||
|
6b08db68bb | ||
|
9550126f76 | ||
|
bad262b961 | ||
|
3c6c10075a | ||
|
6a77a6939e | ||
|
b725a4a140 | ||
|
2b714a5b5d | ||
|
572546088f | ||
|
5b109578d3 | ||
|
77b720f9a5 | ||
|
de954eb9cc | ||
|
3e322e60e4 | ||
|
a3642541d0 | ||
|
bb139d3f91 | ||
|
08743a42e2 | ||
|
cb6e76973d | ||
|
4b760fa9bc | ||
|
5730be093e | ||
|
d85e2ee9c3 | ||
|
fe433b012f | ||
|
5e3ffb39a2 | ||
|
f0edefdbb7 | ||
|
17901ea5c2 | ||
|
187fc54596 | ||
|
c951ad7c7b | ||
|
9785975f77 | ||
|
79281049f2 | ||
|
7d2b84aab6 | ||
|
cda328fa7e | ||
|
5d7b75a47a | ||
|
ae86824636 | ||
|
0dde40ce0b | ||
|
369c9ad12a | ||
|
cfb9eeca20 | ||
|
3dfb68887d | ||
|
d567885070 | ||
|
877c275a13 | ||
|
8aadae8ce4 | ||
|
2232d7603a | ||
|
b3f8851bc2 | ||
|
47ad3f63cf | ||
|
c75adb0671 | ||
|
178b8f5f64 | ||
|
a874992e7c | ||
|
31fc287d35 | ||
|
892913a69d | ||
|
99026e42a9 | ||
|
3a82d2b1a8 | ||
|
b28292e454 | ||
|
2ff18bc948 | ||
|
d0bee487e0 | ||
|
419e29c5a6 | ||
|
295d111f0e | ||
|
da5eb2db67 | ||
|
3408e4d4fa | ||
|
6d7eca8e42 | ||
|
5726a71b62 | ||
|
f73b5057ac | ||
|
51051aad7f | ||
|
91d3c08248 | ||
|
52f2cf319a | ||
|
bbdb62e654 | ||
|
e024943c4b | ||
|
7f44ec512e | ||
|
a2b6ddb7b1 | ||
|
bdc37b0797 | ||
|
82aaebfea2 | ||
|
48d82224ee | ||
|
100afcfdb0 | ||
|
b3436d5eba | ||
|
c5371aca64 | ||
|
269619a419 | ||
|
9b3104577c | ||
|
a1697d2307 | ||
|
056b75858c | ||
|
c84ed90272 | ||
|
b21dd9891a | ||
|
bba81781af | ||
|
0c74a72fac | ||
|
1822bc5eaf | ||
|
01ffe10c2f | ||
|
7f99a547f5 | ||
|
0e5651fb80 | ||
|
0ca44f3001 | ||
|
3f85763797 | ||
|
b318c4c5c9 | ||
|
ae9703712a | ||
|
d617ab6662 | ||
|
4c3eebd3e5 | ||
|
10061af491 | ||
|
91621641e6 | ||
|
35c6931ade | ||
|
44622912a2 | ||
|
aac40cf89b | ||
|
d4b20f5793 | ||
|
89df2d9475 | ||
|
79fa6f8d58 | ||
|
69242938f7 | ||
|
1b66b5d941 | ||
|
fb30f7ddcb | ||
|
747c2a4208 | ||
|
43fda26275 | ||
|
b1222bf83e | ||
|
3ec41b656f | ||
|
740ef6cd9e | ||
|
8c5cbf698b | ||
|
5f2cf6623f | ||
|
4b7efb73d7 | ||
|
a6b7e34187 | ||
|
e50308e823 | ||
|
b6a13ce43a | ||
|
96a87a811d | ||
|
025ee03cb1 | ||
|
c06ee92251 | ||
|
3aca5965dc | ||
|
cac77e5ffa | ||
|
49f1d7b5f6 | ||
|
82e44dbf04 | ||
|
9b501dd9eb | ||
|
8ba663f6f4 | ||
|
8f35484262 | ||
|
1e3143656d | ||
|
699b1f5012 | ||
|
9c877a621e | ||
|
a3144150e0 | ||
|
c830083df3 | ||
|
9eb03b1bcd | ||
|
7e3136c347 | ||
|
c3de8016c0 | ||
|
af45863f8e | ||
|
08d7d1673e | ||
|
e7c56ccd1e | ||
|
de8cab8e60 | ||
|
9e0f751464 | ||
|
951a429ac5 | ||
|
e43bb9da19 | ||
|
b08bd572ef | ||
|
402ee11273 | ||
|
6e38a26f32 | ||
|
d66239bea8 | ||
|
7eb8df2777 | ||
|
75473fd924 | ||
|
c94ade8ffd | ||
|
61afbd43c9 | ||
|
64f6ea37bd | ||
|
dc0609d153 | ||
|
bd46344a4e | ||
|
7199902316 | ||
|
250873abf2 | ||
|
1e775ecb83 | ||
|
9718c517d9 | ||
|
afc215aa66 | ||
|
5df8157863 | ||
|
802fe6bb29 | ||
|
27d2ad198e | ||
|
63be3ff84c | ||
|
66045bd13d | ||
|
f5f8105b57 | ||
|
4f92ae46ef | ||
|
80f8aa3c7e | ||
|
42778f687b | ||
|
7b27a58b97 | ||
|
a40ba9d350 | ||
|
9ecdff14fa | ||
|
288adc49c9 | ||
|
b8c2428b31 | ||
|
92bfcbafc0 | ||
|
130b5beca2 | ||
|
adb2e0fdd6 | ||
|
0a04bd7f2f | ||
|
9d6af5b314 | ||
|
6efb4b90d4 | ||
|
5806f1728c | ||
|
a9dd527748 | ||
|
db3d20b7b7 | ||
|
acd4e01aaf | ||
|
b217f23ba5 | ||
|
76875af207 | ||
|
f2ba14c309 | ||
|
a65b79a944 | ||
|
681b580fd8 | ||
|
b985b6c377 | ||
|
92eda21e78 | ||
|
0cfdb50477 | ||
|
1eb9a5edd9 | ||
|
383b881748 | ||
|
47543c8fba | ||
|
dc6ed89bfa | ||
|
348dd368b5 | ||
|
40eeefd4f7 | ||
|
47892c17ce | ||
|
f2a369fb73 | ||
|
61dc10ef66 | ||
|
7d01f4d8b1 | ||
|
c7a5e1e290 | ||
|
fbd332dee8 | ||
|
dbf6a12134 | ||
|
dbc47ae383 | ||
|
f22cfd52e0 | ||
|
2a10337344 | ||
|
836eaa62df | ||
|
a01c7adcfb | ||
|
5133faa1ad | ||
|
6a8c2960ad | ||
|
0c98e89fdb | ||
|
5f78181911 | ||
|
03dd1d23fa | ||
|
91683be798 | ||
|
109cb1a562 | ||
|
ad1240e276 | ||
|
2e468d9c8c | ||
|
6caa94b779 | ||
|
429a7eeee3 | ||
|
dec1172f38 | ||
|
afaafb4126 | ||
|
e566fcca08 | ||
|
c7f7ba250c | ||
|
7e3be21811 | ||
|
5e39f1a57c | ||
|
5aa0f44a9b | ||
|
55c767ba7f | ||
|
5502a97f7f | ||
|
8ab1d81917 | ||
|
942543f6a5 | ||
|
a69545a6ae | ||
|
0b13a0c168 | ||
|
d8341ca3b0 | ||
|
34ac314101 | ||
|
02c00f2711 | ||
|
15231c3304 | ||
|
d98e5aef97 | ||
|
5b0dfa471f | ||
|
26481a6553 | ||
|
64e08aa98b |
158
.travis.yml
158
.travis.yml
@@ -1,136 +1,68 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
language: java
|
||||||
# All rights reserved.
|
|
||||||
#
|
|
||||||
# This source code is licensed under the BSD-style license found in the
|
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
os: osx
|
|
||||||
osx_image: xcode8.2
|
|
||||||
language: cpp
|
|
||||||
compiler: clang
|
|
||||||
cache:
|
|
||||||
directories:
|
|
||||||
- $HOME/Library/Caches/Homebrew
|
|
||||||
- $HOME/android-sdk
|
|
||||||
- $HOME/android-ndk
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
- TARGET=c
|
- TARGET: website
|
||||||
- TARGET=java
|
- TARGET: android
|
||||||
- TARGET=net
|
|
||||||
- TARGET=ios
|
install:
|
||||||
- TARGET=js
|
- cd website
|
||||||
- TARGET=android
|
- yarn --ignore-scripts
|
||||||
|
- cd ..
|
||||||
|
|
||||||
|
cache:
|
||||||
|
directories:
|
||||||
|
- $HOME/buck
|
||||||
|
- $HOME/.gradle
|
||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- |
|
- |
|
||||||
if [[ -n "$encrypted_d27e803291ff_iv" ]]; then
|
if [[ -n "$encrypted_d27e803291ff_iv" ]]; then
|
||||||
openssl aes-256-cbc -K $encrypted_d27e803291ff_key -iv $encrypted_d27e803291ff_iv -in scripts/setup-keys.enc -d >> gradle.properties;
|
openssl aes-256-cbc -K $encrypted_d27e803291ff_key -iv $encrypted_d27e803291ff_iv -in scripts/setup-keys.enc -d >> gradle.properties;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- brew update > /dev/null
|
|
||||||
- brew install --HEAD facebook/fb/buck
|
|
||||||
|
|
||||||
# Java
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "java" ]]; then
|
|
||||||
brew cask install java &&
|
|
||||||
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8) &&
|
|
||||||
export PATH=$JAVA_HOME/bin:$PATH
|
|
||||||
fi
|
|
||||||
|
|
||||||
# .NET
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "net" ]]; then
|
|
||||||
brew install mono
|
|
||||||
fi
|
|
||||||
|
|
||||||
# iOS
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "ios" ]]; then
|
|
||||||
brew outdated xctool || brew upgrade xctool;
|
|
||||||
gem install xcpretty --no-document --quiet;
|
|
||||||
gem install cocoapods --pre --no-document --quiet;
|
|
||||||
pod repo update --silent;
|
|
||||||
pod install --project-directory=YogaKit/YogaKitSample/;
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Emscripten (used for js tests)
|
|
||||||
# Note: cannot be ran on Linux (because it will compile Clang from its sources :|)
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "js" ]]; then
|
|
||||||
wget -O /tmp/emsdk-portable.tar.gz https://s3.amazonaws.com/mozilla-games/emscripten/releases/emsdk-portable.tar.gz &&
|
|
||||||
tar xf /tmp/emsdk-portable.tar.gz -C /tmp/ &&
|
|
||||||
/tmp/emsdk-portable/emsdk install latest 2>&1 | grep -v '^x ' &&
|
|
||||||
/tmp/emsdk-portable/emsdk activate latest
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Android
|
# Android
|
||||||
- |
|
- |
|
||||||
if [[ $TARGET = "android" ]]; then
|
if [[ $TARGET = "android" ]]; then
|
||||||
brew cask install java;
|
pushd $HOME
|
||||||
export JAVA_HOME=$(/usr/libexec/java_home -v 1.8);
|
git clone --depth 1 https://github.com/facebook/buck.git
|
||||||
export PATH=$JAVA_HOME/bin:$PATH;
|
cd buck
|
||||||
export TERMINAL=dumb;
|
ant
|
||||||
|
popd
|
||||||
|
export PATH=$PATH:$HOME/buck/bin/
|
||||||
|
buck --version
|
||||||
|
export TERMINAL=dumb
|
||||||
source scripts/android-setup.sh && installAndroidSDK
|
source scripts/android-setup.sh && installAndroidSDK
|
||||||
export ANDROID_SDK=$ANDROID_HOME
|
export ANDROID_SDK=$ANDROID_HOME
|
||||||
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
|
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
|
||||||
export ANDROID_NDK_HOME=$ANDROID_NDK_REPOSITORY/android-ndk-r15c
|
export ANDROID_NDK_HOME=$ANDROID_NDK_REPOSITORY/android-ndk-r15c
|
||||||
fi
|
fi
|
||||||
|
# Website
|
||||||
# JavaScript
|
|
||||||
- |
|
- |
|
||||||
if [[ $TARGET = "js" ]]; then (
|
if [[ $TARGET = "website" ]]; then
|
||||||
cd javascript &&
|
nvm install 8
|
||||||
npm install &&
|
nvm use 8
|
||||||
unset CC && unset CXX && unset LINK &&
|
fi
|
||||||
source /tmp/emsdk-portable/emsdk_env.sh &&
|
|
||||||
npm run build:browser
|
|
||||||
) fi
|
|
||||||
|
|
||||||
script:
|
script:
|
||||||
# C
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "c" ]]; then
|
|
||||||
buck test --verbose 0 //:yoga &&
|
|
||||||
buck run --verbose 0 //benchmark:benchmark &&
|
|
||||||
git checkout HEAD^ &&
|
|
||||||
buck run --verbose 0 //benchmark:benchmark
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Java
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "java" ]]; then
|
|
||||||
buck test --verbose 0 //java:java
|
|
||||||
fi
|
|
||||||
|
|
||||||
# .NET
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "net" ]]; then
|
|
||||||
sh csharp/tests/Facebook.Yoga/test_macos.sh
|
|
||||||
fi
|
|
||||||
|
|
||||||
# iOS
|
|
||||||
- |
|
|
||||||
if [[ $TARGET = "ios" ]]; then
|
|
||||||
buck test --verbose 0 //YogaKit:YogaKitTests --config cxx.default_platform=iphonesimulator-x86_64 &&
|
|
||||||
set -o pipefail &&
|
|
||||||
xcodebuild build -workspace YogaKit/YogaKitSample/YogaKitSample.xcworkspace -scheme YogaKitSample -sdk iphonesimulator | xcpretty -c
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Android
|
|
||||||
- |
|
- |
|
||||||
if [[ $TARGET = "android" ]]; then
|
if [[ $TARGET = "android" ]]; then
|
||||||
buck build --verbose 0 //android/sample:sample &&
|
./gradlew testDebugUnit && scripts/publish-snapshot.sh
|
||||||
./gradlew testDebugUnit &&
|
fi
|
||||||
scripts/publish-snapshot.sh
|
- |
|
||||||
|
if [[ $TARGET = "website" ]]; then
|
||||||
|
pushd website
|
||||||
|
yarn build
|
||||||
|
popd
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# JavaScript
|
deploy:
|
||||||
- |
|
provider: pages
|
||||||
if [[ $TARGET = "js" ]]; then (
|
skip-cleanup: true
|
||||||
cd javascript &&
|
github-token: $GITHUB_TOKEN
|
||||||
npm run test:all &&
|
fqdn: yogalayout.com
|
||||||
npm run bench
|
local-dir: website/public
|
||||||
) fi
|
email: yogabot@fb.com
|
||||||
|
name: Yoga-bot
|
||||||
|
keep-history: true
|
||||||
|
on:
|
||||||
|
branch: master
|
||||||
|
condition: $TARGET = website
|
||||||
|
23
BUCK
23
BUCK
@@ -1,11 +1,8 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) 2014-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "LIBRARY_COMPILER_FLAGS", "subdir_glob", "yoga_cxx_library", "yoga_cxx_test", "yoga_dep")
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
GMOCK_OVERRIDE_FLAGS = [
|
GMOCK_OVERRIDE_FLAGS = [
|
||||||
# gmock does not mark mocked methods as override, ignore the warnings in tests
|
# gmock does not mark mocked methods as override, ignore the warnings in tests
|
||||||
@@ -13,26 +10,28 @@ GMOCK_OVERRIDE_FLAGS = [
|
|||||||
]
|
]
|
||||||
|
|
||||||
COMPILER_FLAGS = LIBRARY_COMPILER_FLAGS + [
|
COMPILER_FLAGS = LIBRARY_COMPILER_FLAGS + [
|
||||||
"-std=c11",
|
"-std=c++1y",
|
||||||
]
|
]
|
||||||
|
|
||||||
TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + ["-std=c++11"]
|
TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + [
|
||||||
|
"-std=c++1y",
|
||||||
|
]
|
||||||
|
|
||||||
cxx_library(
|
yoga_cxx_library(
|
||||||
name = "yoga",
|
name = "yoga",
|
||||||
srcs = glob(["yoga/*.c"]),
|
srcs = glob(["yoga/*.cpp"]),
|
||||||
header_namespace = "",
|
header_namespace = "",
|
||||||
exported_headers = subdir_glob([("", "yoga/*.h")]),
|
exported_headers = subdir_glob([("", "yoga/*.h")]),
|
||||||
compiler_flags = COMPILER_FLAGS,
|
compiler_flags = COMPILER_FLAGS,
|
||||||
soname = "libyogacore.$(ext)",
|
soname = "libyogacore.$(ext)",
|
||||||
tests = [":YogaTests"],
|
tests = [":YogaTests"],
|
||||||
visibility = ["PUBLIC"],
|
visibility = ["PUBLIC"],
|
||||||
deps = [] if THIS_IS_FBOBJC else [
|
deps = [
|
||||||
yoga_dep("lib/fb:ndklog"),
|
yoga_dep("lib/fb:ndklog"),
|
||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
cxx_test(
|
yoga_cxx_test(
|
||||||
name = "YogaTests",
|
name = "YogaTests",
|
||||||
srcs = glob(["tests/*.cpp"]),
|
srcs = glob(["tests/*.cpp"]),
|
||||||
compiler_flags = TEST_COMPILER_FLAGS,
|
compiler_flags = TEST_COMPILER_FLAGS,
|
||||||
|
@@ -1,17 +1,15 @@
|
|||||||
#
|
#
|
||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) 2014-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
#
|
#
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.4.1)
|
cmake_minimum_required(VERSION 3.4.1)
|
||||||
|
|
||||||
set(CMAKE_VERBOSE_MAKEFILE on)
|
set(CMAKE_VERBOSE_MAKEFILE on)
|
||||||
|
|
||||||
file(GLOB yogacore_SRC yoga/*.c)
|
file(GLOB yogacore_SRC yoga/*.cpp)
|
||||||
add_library(yogacore STATIC ${yogacore_SRC})
|
add_library(yogacore STATIC ${yogacore_SRC})
|
||||||
|
|
||||||
target_link_libraries(yogacore android log)
|
target_link_libraries(yogacore android log)
|
||||||
|
3
CODE_OF_CONDUCT.md
Normal file
3
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
# Code of Conduct
|
||||||
|
|
||||||
|
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.facebook.com/pages/876921332402685/open-source-code-of-conduct) so that you can understand what actions will and will not be tolerated.
|
@@ -2,6 +2,10 @@
|
|||||||
We want to make contributing to this project as easy and transparent as
|
We want to make contributing to this project as easy and transparent as
|
||||||
possible.
|
possible.
|
||||||
|
|
||||||
|
## Code of Conduct
|
||||||
|
|
||||||
|
Facebook has adopted a Code of Conduct that we expect project participants to adhere to. Please [read the full text](https://code.facebook.com/pages/876921332402685/open-source-code-of-conduct) so that you can understand what actions will and will not be tolerated.
|
||||||
|
|
||||||
## Pull Requests
|
## Pull Requests
|
||||||
We actively welcome your pull requests.
|
We actively welcome your pull requests.
|
||||||
1. Fork the repo and create your branch from `master`.
|
1. Fork the repo and create your branch from `master`.
|
||||||
@@ -25,9 +29,6 @@ Facebook has a [bounty program](https://www.facebook.com/whitehat/) for the safe
|
|||||||
disclosure of security bugs. In those cases, please go through the process
|
disclosure of security bugs. In those cases, please go through the process
|
||||||
outlined on that page and do not file a public issue.
|
outlined on that page and do not file a public issue.
|
||||||
|
|
||||||
## Coding Style
|
|
||||||
* format.sh
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
By contributing to yoga, you agree that your contributions will be licensed
|
By contributing to yoga, you agree that your contributions will be licensed
|
||||||
under its BSD license.
|
under its MIT license.
|
||||||
|
43
LICENSE
43
LICENSE
@@ -1,30 +1,21 @@
|
|||||||
BSD License
|
MIT License
|
||||||
|
|
||||||
For yoga software
|
Copyright (c) 2014-present, Facebook, Inc.
|
||||||
|
|
||||||
Copyright (c) 2014-present, Facebook, Inc. All rights reserved.
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification,
|
The above copyright notice and this permission notice shall be included in all
|
||||||
are permitted provided that the following conditions are met:
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
* Redistributions of source code must retain the above copyright notice, this
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
list of conditions and the following disclaimer.
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
* Redistributions in binary form must reproduce the above copyright notice,
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
this list of conditions and the following disclaimer in the documentation
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
and/or other materials provided with the distribution.
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
* Neither the name Facebook nor the names of its contributors may be used to
|
|
||||||
endorse or promote products derived from this software without specific
|
|
||||||
prior written permission.
|
|
||||||
|
|
||||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
||||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
||||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
||||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
|
||||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
|
||||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
|
||||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
|
||||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
|
||||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
|
||||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
||||||
|
33
PATENTS
33
PATENTS
@@ -1,33 +0,0 @@
|
|||||||
Additional Grant of Patent Rights Version 2
|
|
||||||
|
|
||||||
"Software" means the yoga software distributed by Facebook, Inc.
|
|
||||||
|
|
||||||
Facebook, Inc. (“Facebook”) hereby grants to each recipient of the Software
|
|
||||||
(“you”) a perpetual, worldwide, royalty-free, non-exclusive, irrevocable
|
|
||||||
(subject to the termination provision below) license under any Necessary
|
|
||||||
Claims, to make, have made, use, sell, offer to sell, import, and otherwise
|
|
||||||
transfer the Software. For avoidance of doubt, no license is granted under
|
|
||||||
Facebook's rights in any patent claims that are infringed by (i) modifications
|
|
||||||
to the Software made by you or any third party or (ii) the Software in
|
|
||||||
combination with any software or other technology.
|
|
||||||
|
|
||||||
The license granted hereunder will terminate, automatically and without notice,
|
|
||||||
if you (or any of your subsidiaries, corporate affiliates or agents) initiate
|
|
||||||
directly or indirectly, or take a direct financial interest in, any Patent
|
|
||||||
Assertion: (i) against Facebook or any of its subsidiaries or corporate
|
|
||||||
affiliates, (ii) against any party if such Patent Assertion arises in whole or
|
|
||||||
in part from any software, technology, product or service of Facebook or any of
|
|
||||||
its subsidiaries or corporate affiliates, or (iii) against any party relating
|
|
||||||
to the Software. Notwithstanding the foregoing, if Facebook or any of its
|
|
||||||
subsidiaries or corporate affiliates files a lawsuit alleging patent
|
|
||||||
infringement against you in the first instance, and you respond by filing a
|
|
||||||
patent infringement counterclaim in that lawsuit against that party that is
|
|
||||||
unrelated to the Software, the license granted hereunder will not terminate
|
|
||||||
under section (i) of this paragraph due to such counterclaim.
|
|
||||||
|
|
||||||
A "Necessary Claim" is a claim of a patent owned by Facebook that is
|
|
||||||
necessarily infringed by the Software standing alone.
|
|
||||||
|
|
||||||
A "Patent Assertion" is any lawsuit or other action alleging direct, indirect,
|
|
||||||
or contributory infringement or inducement to infringe any patent, including a
|
|
||||||
cross-claim or counterclaim.
|
|
15
README.md
15
README.md
@@ -1,15 +1,5 @@
|
|||||||
# Yoga [](http://cocoapods.org/pods/YogaKit) [](https://www.npmjs.com/package/yoga-layout) [](https://bintray.com/facebook/maven/com.facebook.yoga%3Ayoga/_latestVersion) [](https://www.nuget.org/packages/Facebook.Yoga)
|
# Yoga [](http://cocoapods.org/pods/YogaKit) [](https://www.npmjs.com/package/yoga-layout) [](https://bintray.com/facebook/maven/com.facebook.yoga%3Ayoga/_latestVersion) [](https://www.nuget.org/packages/Facebook.Yoga)
|
||||||
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
[](https://travis-ci.org/facebook/yoga)
|
|
||||||
|
|
||||||
[]()
|
|
||||||
[]()
|
|
||||||
|
|
||||||
## Building
|
## Building
|
||||||
Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable.
|
Yoga builds with [buck](https://buckbuild.com). Make sure you install buck before contributing to Yoga. Yoga's main implementation is in C, with bindings to supported languages and frameworks. When making changes to Yoga please ensure the changes are also propagated to these bindings when applicable.
|
||||||
|
|
||||||
@@ -33,9 +23,6 @@ You may need to install the latest watir-webdriver gem (`gem install watir-webdr
|
|||||||
### .NET
|
### .NET
|
||||||
.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, `csharp/tests/Facebook.Yoga/test_macos.sh`.
|
.NET testing is not integrated in buck yet, you might need to set up .NET testing environment. We have a script which to launch C# test on macOS, `csharp/tests/Facebook.Yoga/test_macos.sh`.
|
||||||
|
|
||||||
## Code style
|
|
||||||
For the main C implementation of Yoga clang-format is used to ensure a consistent code style. Please run `bash format.sh` before submitting a pull request. For other languages just try to follow the current code style.
|
|
||||||
|
|
||||||
## Benchmarks
|
## Benchmarks
|
||||||
Benchmarks are located in `benchmark/YGBenchmark.c` and can be run with `buck run //benchmark:benchmark`. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI.
|
Benchmarks are located in `benchmark/YGBenchmark.c` and can be run with `buck run //benchmark:benchmark`. If you think your change has affected performance please run this before and after your change to validate that nothing has regressed. Benchmarks are run on every commit in CI.
|
||||||
|
|
||||||
@@ -59,5 +46,3 @@ This will now only run the standalone webpack build upon install.
|
|||||||
| node | Builds node js version. |
|
| node | Builds node js version. |
|
||||||
| standalone | Runs webpack. |
|
| standalone | Runs webpack. |
|
||||||
| none | Does nothing. You can use the prepackaged libs. |
|
| none | Does nothing. You can use the prepackaged libs. |
|
||||||
|
|
||||||
|
|
||||||
|
47
YOGA_DEFS
47
YOGA_DEFS
@@ -1,47 +0,0 @@
|
|||||||
|
|
||||||
YOGA_ROOTS = ['//...']
|
|
||||||
JAVA_TARGET = '//java:java'
|
|
||||||
INFER_ANNOTATIONS_TARGET = '//lib/infer-annotations:infer-annotations'
|
|
||||||
JSR_305_TARGET = '//lib/jsr-305:jsr-305'
|
|
||||||
JUNIT_TARGET = '//lib/junit:junit'
|
|
||||||
PROGRUARD_ANNOTATIONS_TARGET = '//java/proguard-annotations/src/main/java/com/facebook/proguard/annotations:annotations'
|
|
||||||
SOLOADER_TARGET = '//lib/soloader:soloader'
|
|
||||||
GTEST_TARGET = '//lib/gtest:gtest'
|
|
||||||
JNI_TARGET = '//lib/jni:jni'
|
|
||||||
FBJNI_TARGET = '//lib/fb:fbjni'
|
|
||||||
FBJNI_JAVA_TARGET = '//lib/fb/src/main/java/com/facebook/jni:jni'
|
|
||||||
APPCOMPAT_TARGET = '//lib/appcompat:appcompat'
|
|
||||||
ANDROID_SUPPORT_TARGET = '//lib/android-support:android-support'
|
|
||||||
ANDROID_TARGET = '//android:android'
|
|
||||||
ANDROID_JAVA_TARGET = '//android/src/main/java/com/facebook/yoga/android:android'
|
|
||||||
ANDROID_RES_TARGET = '//android:res'
|
|
||||||
ANDROID_SAMPLE_JAVA_TARGET = '//android/sample/java/com/facebook/samples/yoga:yoga'
|
|
||||||
ANDROID_SAMPLE_RES_TARGET = '//android/sample:res'
|
|
||||||
|
|
||||||
THIS_IS_FBOBJC = False
|
|
||||||
|
|
||||||
CXX_LIBRARY_WHITELIST = [
|
|
||||||
'//:yoga',
|
|
||||||
'//lib/fb:fbjni',
|
|
||||||
'//java:jni',
|
|
||||||
]
|
|
||||||
|
|
||||||
BASE_COMPILER_FLAGS = [
|
|
||||||
'-fno-omit-frame-pointer',
|
|
||||||
'-fexceptions',
|
|
||||||
'-Wall',
|
|
||||||
'-Werror',
|
|
||||||
'-O3',
|
|
||||||
]
|
|
||||||
|
|
||||||
LIBRARY_COMPILER_FLAGS = BASE_COMPILER_FLAGS + [
|
|
||||||
'-fPIC',
|
|
||||||
]
|
|
||||||
|
|
||||||
def yoga_dep(dep):
|
|
||||||
return '//' + dep
|
|
||||||
|
|
||||||
with allow_unsafe_import():
|
|
||||||
import os.path
|
|
||||||
def isdir(filename):
|
|
||||||
return os.path.isdir(filename)
|
|
21
Yoga.podspec
21
Yoga.podspec
@@ -1,9 +1,9 @@
|
|||||||
Pod::Spec.new do |spec|
|
Pod::Spec.new do |spec|
|
||||||
spec.name = 'Yoga'
|
spec.name = 'Yoga'
|
||||||
spec.version = '1.7.0'
|
spec.version = '1.9.0'
|
||||||
spec.license = { :type => 'BSD', :file => "LICENSE" }
|
spec.license = { :type => 'MIT', :file => "LICENSE" }
|
||||||
spec.homepage = 'https://facebook.github.io/yoga/'
|
spec.homepage = 'https://yogalayout.com/'
|
||||||
spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/c/'
|
spec.documentation_url = 'https://yogalayout.com/docs'
|
||||||
|
|
||||||
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
spec.summary = 'Yoga is a cross-platform layout engine which implements Flexbox.'
|
||||||
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
spec.description = 'Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.'
|
||||||
@@ -11,18 +11,23 @@ Pod::Spec.new do |spec|
|
|||||||
spec.authors = 'Facebook'
|
spec.authors = 'Facebook'
|
||||||
spec.source = {
|
spec.source = {
|
||||||
:git => 'https://github.com/facebook/yoga.git',
|
:git => 'https://github.com/facebook/yoga.git',
|
||||||
:tag => '1.7.0',
|
:tag => spec.version.to_s,
|
||||||
}
|
}
|
||||||
|
spec.platforms = { :ios => "8.0", :tvos => "10.0" }
|
||||||
spec.module_name = 'yoga'
|
spec.module_name = 'yoga'
|
||||||
spec.requires_arc = false
|
spec.requires_arc = false
|
||||||
|
spec.pod_target_xcconfig = {
|
||||||
|
'DEFINES_MODULE' => 'YES'
|
||||||
|
}
|
||||||
spec.compiler_flags = [
|
spec.compiler_flags = [
|
||||||
'-fno-omit-frame-pointer',
|
'-fno-omit-frame-pointer',
|
||||||
'-fexceptions',
|
'-fexceptions',
|
||||||
'-Wall',
|
'-Wall',
|
||||||
'-Werror',
|
'-Werror',
|
||||||
'-std=c11',
|
'-std=c++1y',
|
||||||
'-fPIC'
|
'-fPIC'
|
||||||
]
|
]
|
||||||
spec.source_files = 'yoga/**/*.{c,h}'
|
spec.source_files = 'yoga/**/*.{c,h,cpp}'
|
||||||
|
spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros}.h'
|
||||||
|
|
||||||
end
|
end
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
podspec = Pod::Spec.new do |spec|
|
podspec = Pod::Spec.new do |spec|
|
||||||
spec.name = 'YogaKit'
|
spec.name = 'YogaKit'
|
||||||
spec.version = '1.7.0'
|
spec.version = '1.9.0'
|
||||||
spec.license = { :type => 'BSD', :file => "LICENSE" }
|
spec.license = { :type => 'MIT', :file => "LICENSE" }
|
||||||
spec.homepage = 'https://facebook.github.io/yoga/'
|
spec.homepage = 'https://facebook.github.io/yoga/'
|
||||||
spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/yogakit/'
|
spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/yogakit/'
|
||||||
|
|
||||||
@@ -11,14 +11,14 @@ podspec = Pod::Spec.new do |spec|
|
|||||||
spec.authors = 'Facebook'
|
spec.authors = 'Facebook'
|
||||||
spec.source = {
|
spec.source = {
|
||||||
:git => 'https://github.com/facebook/yoga.git',
|
:git => 'https://github.com/facebook/yoga.git',
|
||||||
:tag => '1.7.0',
|
:tag => spec.version.to_s,
|
||||||
}
|
}
|
||||||
|
|
||||||
spec.platform = :ios
|
spec.platform = :ios
|
||||||
spec.ios.deployment_target = '8.0'
|
spec.ios.deployment_target = '8.0'
|
||||||
spec.ios.frameworks = 'UIKit'
|
spec.ios.frameworks = 'UIKit'
|
||||||
|
|
||||||
spec.dependency 'Yoga', '~> 1.7'
|
spec.dependency 'Yoga', '~> 1.9'
|
||||||
spec.source_files = 'YogaKit/Source/*.{h,m,swift}'
|
spec.source_files = 'YogaKit/Source/*.{h,m,swift}'
|
||||||
spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h'
|
spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h'
|
||||||
spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h'
|
spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h'
|
||||||
|
23
YogaKit/BUCK
23
YogaKit/BUCK
@@ -1,11 +1,8 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) 2014-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
load("//:yoga_defs.bzl", "subdir_glob", "yoga_apple_library", "yoga_apple_test", "yoga_dep")
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
|
||||||
|
|
||||||
COMPILER_FLAGS = [
|
COMPILER_FLAGS = [
|
||||||
"-fobjc-arc",
|
"-fobjc-arc",
|
||||||
@@ -27,15 +24,23 @@ COMPILER_FLAGS = [
|
|||||||
"-Wunused-value",
|
"-Wunused-value",
|
||||||
]
|
]
|
||||||
|
|
||||||
apple_library(
|
yoga_apple_library(
|
||||||
name = "YogaKit",
|
name = "YogaKit",
|
||||||
srcs = glob(["Source/**/*.m"]),
|
srcs = glob(["Source/**/*.m"]),
|
||||||
exported_headers = glob(["Source/**/*.h"]),
|
header_namespace = "",
|
||||||
|
exported_headers = subdir_glob(
|
||||||
|
[
|
||||||
|
("", "Source/**/*.h"),
|
||||||
|
("Source", "**/*.h"),
|
||||||
|
],
|
||||||
|
prefix = "YogaKit",
|
||||||
|
),
|
||||||
compiler_flags = COMPILER_FLAGS,
|
compiler_flags = COMPILER_FLAGS,
|
||||||
frameworks = [
|
frameworks = [
|
||||||
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
|
"$SDKROOT/System/Library/Frameworks/Foundation.framework",
|
||||||
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
|
"$SDKROOT/System/Library/Frameworks/UIKit.framework",
|
||||||
],
|
],
|
||||||
|
header_path_prefix = "",
|
||||||
link_whole = True,
|
link_whole = True,
|
||||||
visibility = ["PUBLIC"],
|
visibility = ["PUBLIC"],
|
||||||
deps = [
|
deps = [
|
||||||
@@ -43,7 +48,7 @@ apple_library(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
apple_test(
|
yoga_apple_test(
|
||||||
name = "YogaKitTests",
|
name = "YogaKitTests",
|
||||||
srcs = glob(["Tests/**/*.m"]),
|
srcs = glob(["Tests/**/*.m"]),
|
||||||
compiler_flags = COMPILER_FLAGS,
|
compiler_flags = COMPILER_FLAGS,
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "YGLayout.h"
|
#import "YGLayout.h"
|
||||||
@@ -12,7 +10,7 @@
|
|||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
typedef void (^YGLayoutConfigurationBlock)(YGLayout *);
|
typedef void (^YGLayoutConfigurationBlock)(YGLayout *layout);
|
||||||
|
|
||||||
@interface UIView (Yoga)
|
@interface UIView (Yoga)
|
||||||
|
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "UIView+Yoga.h"
|
#import "UIView+Yoga.h"
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "YGLayout.h"
|
#import "YGLayout.h"
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
@@ -23,13 +21,21 @@ YG_EXTERN_C_END
|
|||||||
|
|
||||||
typedef NS_OPTIONS(NSInteger, YGDimensionFlexibility) {
|
typedef NS_OPTIONS(NSInteger, YGDimensionFlexibility) {
|
||||||
YGDimensionFlexibilityFlexibleWidth = 1 << 0,
|
YGDimensionFlexibilityFlexibleWidth = 1 << 0,
|
||||||
YGDimensionFlexibilityFlexibleHeigth = 1 << 1,
|
YGDimensionFlexibilityFlexibleHeight = 1 << 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
@interface YGLayout : NSObject
|
@interface YGLayout : NSObject
|
||||||
|
|
||||||
/**
|
/**
|
||||||
The property that decides if we should include this view when calculating layout. Defaults to YES.
|
Make default init unavailable, as it will not initialise YGNode which is
|
||||||
|
required for the setters and getters of YGLayout's properties to work properly.
|
||||||
|
*/
|
||||||
|
- (instancetype)init
|
||||||
|
__attribute__((unavailable("you are not meant to initialise YGLayout")));
|
||||||
|
|
||||||
|
/**
|
||||||
|
The property that decides if we should include this view when calculating
|
||||||
|
layout. Defaults to YES.
|
||||||
*/
|
*/
|
||||||
@property (nonatomic, readwrite, assign, setter=setIncludedInLayout:) BOOL isIncludedInLayout;
|
@property (nonatomic, readwrite, assign, setter=setIncludedInLayout:) BOOL isIncludedInLayout;
|
||||||
|
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import "YGLayout+Private.h"
|
#import "YGLayout+Private.h"
|
||||||
@@ -30,6 +28,9 @@
|
|||||||
- (void)set##capitalized_name:(YGValue)lowercased_name \
|
- (void)set##capitalized_name:(YGValue)lowercased_name \
|
||||||
{ \
|
{ \
|
||||||
switch (lowercased_name.unit) { \
|
switch (lowercased_name.unit) { \
|
||||||
|
case YGUnitUndefined: \
|
||||||
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
case YGUnitPoint: \
|
case YGUnitPoint: \
|
||||||
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
||||||
break; \
|
break; \
|
||||||
@@ -41,6 +42,29 @@
|
|||||||
} \
|
} \
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define YG_AUTO_VALUE_PROPERTY(lowercased_name, capitalized_name) \
|
||||||
|
- (YGValue)lowercased_name \
|
||||||
|
{ \
|
||||||
|
return YGNodeStyleGet##capitalized_name(self.node); \
|
||||||
|
} \
|
||||||
|
\
|
||||||
|
- (void)set##capitalized_name:(YGValue)lowercased_name \
|
||||||
|
{ \
|
||||||
|
switch (lowercased_name.unit) { \
|
||||||
|
case YGUnitPoint: \
|
||||||
|
YGNodeStyleSet##capitalized_name(self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
case YGUnitPercent: \
|
||||||
|
YGNodeStyleSet##capitalized_name##Percent(self.node, lowercased_name.value); \
|
||||||
|
break; \
|
||||||
|
case YGUnitAuto: \
|
||||||
|
YGNodeStyleSet##capitalized_name##Auto(self.node); \
|
||||||
|
break; \
|
||||||
|
default: \
|
||||||
|
NSAssert(NO, @"Not implemented"); \
|
||||||
|
} \
|
||||||
|
}
|
||||||
|
|
||||||
#define YG_EDGE_PROPERTY_GETTER(type, lowercased_name, capitalized_name, property, edge) \
|
#define YG_EDGE_PROPERTY_GETTER(type, lowercased_name, capitalized_name, property, edge) \
|
||||||
- (type)lowercased_name \
|
- (type)lowercased_name \
|
||||||
{ \
|
{ \
|
||||||
@@ -61,6 +85,9 @@ YG_EDGE_PROPERTY_SETTER(lowercased_name, capitalized_name, property, edge)
|
|||||||
- (void)set##objc_capitalized_name:(YGValue)objc_lowercased_name \
|
- (void)set##objc_capitalized_name:(YGValue)objc_lowercased_name \
|
||||||
{ \
|
{ \
|
||||||
switch (objc_lowercased_name.unit) { \
|
switch (objc_lowercased_name.unit) { \
|
||||||
|
case YGUnitUndefined: \
|
||||||
|
YGNodeStyleSet##c_name(self.node, edge, objc_lowercased_name.value); \
|
||||||
|
break; \
|
||||||
case YGUnitPoint: \
|
case YGUnitPoint: \
|
||||||
YGNodeStyleSet##c_name(self.node, edge, objc_lowercased_name.value); \
|
YGNodeStyleSet##c_name(self.node, edge, objc_lowercased_name.value); \
|
||||||
break; \
|
break; \
|
||||||
@@ -202,7 +229,7 @@ YG_PROPERTY(YGDisplay, display, Display)
|
|||||||
|
|
||||||
YG_PROPERTY(CGFloat, flexGrow, FlexGrow)
|
YG_PROPERTY(CGFloat, flexGrow, FlexGrow)
|
||||||
YG_PROPERTY(CGFloat, flexShrink, FlexShrink)
|
YG_PROPERTY(CGFloat, flexShrink, FlexShrink)
|
||||||
YG_VALUE_PROPERTY(flexBasis, FlexBasis)
|
YG_AUTO_VALUE_PROPERTY(flexBasis, FlexBasis)
|
||||||
|
|
||||||
YG_VALUE_EDGE_PROPERTY(left, Left, Position, YGEdgeLeft)
|
YG_VALUE_EDGE_PROPERTY(left, Left, Position, YGEdgeLeft)
|
||||||
YG_VALUE_EDGE_PROPERTY(top, Top, Position, YGEdgeTop)
|
YG_VALUE_EDGE_PROPERTY(top, Top, Position, YGEdgeTop)
|
||||||
@@ -221,8 +248,8 @@ YG_EDGE_PROPERTY(borderStartWidth, BorderStartWidth, Border, YGEdgeStart)
|
|||||||
YG_EDGE_PROPERTY(borderEndWidth, BorderEndWidth, Border, YGEdgeEnd)
|
YG_EDGE_PROPERTY(borderEndWidth, BorderEndWidth, Border, YGEdgeEnd)
|
||||||
YG_EDGE_PROPERTY(borderWidth, BorderWidth, Border, YGEdgeAll)
|
YG_EDGE_PROPERTY(borderWidth, BorderWidth, Border, YGEdgeAll)
|
||||||
|
|
||||||
YG_VALUE_PROPERTY(width, Width)
|
YG_AUTO_VALUE_PROPERTY(width, Width)
|
||||||
YG_VALUE_PROPERTY(height, Height)
|
YG_AUTO_VALUE_PROPERTY(height, Height)
|
||||||
YG_VALUE_PROPERTY(minWidth, MinWidth)
|
YG_VALUE_PROPERTY(minWidth, MinWidth)
|
||||||
YG_VALUE_PROPERTY(minHeight, MinHeight)
|
YG_VALUE_PROPERTY(minHeight, MinHeight)
|
||||||
YG_VALUE_PROPERTY(maxWidth, MaxWidth)
|
YG_VALUE_PROPERTY(maxWidth, MaxWidth)
|
||||||
@@ -254,7 +281,7 @@ YG_PROPERTY(CGFloat, aspectRatio, AspectRatio)
|
|||||||
if (dimensionFlexibility & YGDimensionFlexibilityFlexibleWidth) {
|
if (dimensionFlexibility & YGDimensionFlexibilityFlexibleWidth) {
|
||||||
size.width = YGUndefined;
|
size.width = YGUndefined;
|
||||||
}
|
}
|
||||||
if (dimensionFlexibility & YGDimensionFlexibilityFlexibleHeigth) {
|
if (dimensionFlexibility & YGDimensionFlexibilityFlexibleHeight) {
|
||||||
size.height = YGUndefined;
|
size.height = YGUndefined;
|
||||||
}
|
}
|
||||||
[self calculateLayoutWithSize:size];
|
[self calculateLayoutWithSize:size];
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
postfix operator %
|
postfix operator %
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#import <XCTest/XCTest.h>
|
#import <XCTest/XCTest.h>
|
||||||
@@ -181,7 +179,9 @@
|
|||||||
view.yoga.height = YGPointValue(100);
|
view.yoga.height = YGPointValue(100);
|
||||||
[container addSubview:view];
|
[container addSubview:view];
|
||||||
|
|
||||||
[container.yoga applyLayoutPreservingOrigin:YES dimensionFlexibility:YGDimensionFlexibilityFlexibleHeigth];
|
[container.yoga
|
||||||
|
applyLayoutPreservingOrigin:YES
|
||||||
|
dimensionFlexibility:YGDimensionFlexibilityFlexibleHeight];
|
||||||
XCTAssertEqual(200, container.frame.size.width);
|
XCTAssertEqual(200, container.frame.size.width);
|
||||||
XCTAssertEqual(100, container.frame.size.height);
|
XCTAssertEqual(100, container.frame.size.height);
|
||||||
}
|
}
|
||||||
@@ -197,7 +197,10 @@
|
|||||||
view.yoga.height = YGPointValue(100);
|
view.yoga.height = YGPointValue(100);
|
||||||
[container addSubview:view];
|
[container addSubview:view];
|
||||||
|
|
||||||
[container.yoga applyLayoutPreservingOrigin:YES dimensionFlexibility:YGDimensionFlexibilityFlexibleWidth | YGDimensionFlexibilityFlexibleHeigth];
|
[container.yoga
|
||||||
|
applyLayoutPreservingOrigin:YES
|
||||||
|
dimensionFlexibility:YGDimensionFlexibilityFlexibleWidth |
|
||||||
|
YGDimensionFlexibilityFlexibleHeight];
|
||||||
XCTAssertEqual(100, container.frame.size.width);
|
XCTAssertEqual(100, container.frame.size.width);
|
||||||
XCTAssertEqual(100, container.frame.size.height);
|
XCTAssertEqual(100, container.frame.size.height);
|
||||||
}
|
}
|
||||||
|
12
android/BUCK
12
android/BUCK
@@ -1,13 +1,11 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) 2014-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "yoga_android_aar", "yoga_android_resource")
|
||||||
|
|
||||||
android_aar(
|
yoga_android_aar(
|
||||||
name = "android",
|
name = "android",
|
||||||
manifest_skeleton = "src/main/AndroidManifest.xml",
|
manifest_skeleton = "src/main/AndroidManifest.xml",
|
||||||
visibility = [
|
visibility = [
|
||||||
@@ -22,7 +20,7 @@ android_aar(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
android_resource(
|
yoga_android_resource(
|
||||||
name = "res",
|
name = "res",
|
||||||
package = "com.facebook.yoga.android",
|
package = "com.facebook.yoga.android",
|
||||||
res = "src/main/res",
|
res = "src/main/res",
|
||||||
|
@@ -4,9 +4,9 @@
|
|||||||
# This source code is licensed under the license found in the
|
# This source code is licensed under the license found in the
|
||||||
# LICENSE-examples file in the root directory of this source tree.
|
# LICENSE-examples file in the root directory of this source tree.
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
load("//:yoga_defs.bzl", "ANDROID_RES_TARGET", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "yoga_android_binary", "yoga_android_resource")
|
||||||
|
|
||||||
android_binary(
|
yoga_android_binary(
|
||||||
name = "sample",
|
name = "sample",
|
||||||
keystore = ":debug_keystore",
|
keystore = ":debug_keystore",
|
||||||
manifest = "AndroidManifest.xml",
|
manifest = "AndroidManifest.xml",
|
||||||
@@ -16,7 +16,7 @@ android_binary(
|
|||||||
],
|
],
|
||||||
)
|
)
|
||||||
|
|
||||||
android_resource(
|
yoga_android_resource(
|
||||||
name = "res",
|
name = "res",
|
||||||
package = "com.facebook.samples.yoga",
|
package = "com.facebook.samples.yoga",
|
||||||
res = "res",
|
res = "res",
|
||||||
|
@@ -1,13 +1,11 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) 2014-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE-examples file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "SOLOADER_TARGET", "yoga_android_library")
|
||||||
|
|
||||||
android_library(
|
yoga_android_library(
|
||||||
name = "yoga",
|
name = "yoga",
|
||||||
srcs = glob(["**/*.java"]),
|
srcs = glob(["**/*.java"]),
|
||||||
visibility = [
|
visibility = [
|
||||||
|
@@ -2,11 +2,9 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 2014-present, Facebook, Inc.
|
Copyright (c) 2014-present, Facebook, Inc.
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
This source code is licensed under the BSD-style license found in the
|
This source code is licensed under the MIT license found in the
|
||||||
LICENSE file in the root directory of this source tree. An additional grant
|
LICENSE file in the root directory of this source tree.
|
||||||
of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
|
@@ -1,13 +1,11 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) 2014-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
load("//:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET", "yoga_android_library")
|
||||||
|
|
||||||
android_library(
|
yoga_android_library(
|
||||||
name = "android",
|
name = "android",
|
||||||
srcs = glob(["**/*.java"]),
|
srcs = glob(["**/*.java"]),
|
||||||
visibility = [
|
visibility = [
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.yoga.android;
|
package com.facebook.yoga.android;
|
||||||
|
@@ -1,17 +1,12 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.yoga.android;
|
package com.facebook.yoga.android;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.res.Configuration;
|
import android.content.res.Configuration;
|
||||||
import android.content.res.TypedArray;
|
import android.content.res.TypedArray;
|
||||||
@@ -23,9 +18,6 @@ import android.util.SparseArray;
|
|||||||
import android.util.TypedValue;
|
import android.util.TypedValue;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.ViewGroup;
|
import android.view.ViewGroup;
|
||||||
import android.util.Log;
|
|
||||||
|
|
||||||
import com.facebook.yoga.android.R;
|
|
||||||
import com.facebook.yoga.YogaAlign;
|
import com.facebook.yoga.YogaAlign;
|
||||||
import com.facebook.yoga.YogaConstants;
|
import com.facebook.yoga.YogaConstants;
|
||||||
import com.facebook.yoga.YogaDirection;
|
import com.facebook.yoga.YogaDirection;
|
||||||
@@ -37,10 +29,11 @@ import com.facebook.yoga.YogaMeasureFunction;
|
|||||||
import com.facebook.yoga.YogaMeasureMode;
|
import com.facebook.yoga.YogaMeasureMode;
|
||||||
import com.facebook.yoga.YogaMeasureOutput;
|
import com.facebook.yoga.YogaMeasureOutput;
|
||||||
import com.facebook.yoga.YogaNode;
|
import com.facebook.yoga.YogaNode;
|
||||||
import com.facebook.yoga.YogaNode;
|
|
||||||
import com.facebook.yoga.YogaOverflow;
|
import com.facebook.yoga.YogaOverflow;
|
||||||
import com.facebook.yoga.YogaPositionType;
|
import com.facebook.yoga.YogaPositionType;
|
||||||
import com.facebook.yoga.YogaWrap;
|
import com.facebook.yoga.YogaWrap;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A {@code ViewGroup} based on the Yoga layout engine.
|
* A {@code ViewGroup} based on the Yoga layout engine.
|
||||||
@@ -53,14 +46,14 @@ import com.facebook.yoga.YogaWrap;
|
|||||||
* <YogaLayout
|
* <YogaLayout
|
||||||
* xmlns:android="http://schemas.android.com/apk/res/android"
|
* xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
* xmlns:yoga="http://schemas.android.com/apk/com.facebook.yoga.android"
|
* xmlns:yoga="http://schemas.android.com/apk/com.facebook.yoga.android"
|
||||||
* android:layout_width="match_parent"
|
* android:layout_width="match_owner"
|
||||||
* android:layout_height="match_parent"
|
* android:layout_height="match_owner"
|
||||||
* yoga:flex_direction="row"
|
* yoga:flex_direction="row"
|
||||||
* yoga:padding_all="10dp"
|
* yoga:padding_all="10dp"
|
||||||
* >
|
* >
|
||||||
* <TextView
|
* <TextView
|
||||||
* android:layout_width="match_parent"
|
* android:layout_width="match_owner"
|
||||||
* android:layout_height="match_parent"
|
* android:layout_height="match_owner"
|
||||||
* android:text="Hello, World!"
|
* android:text="Hello, World!"
|
||||||
* yoga:flex="1"
|
* yoga:flex="1"
|
||||||
* />
|
* />
|
||||||
@@ -269,11 +262,11 @@ public class YogaLayout extends ViewGroup {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
final YogaNode parent = node.getParent();
|
final YogaNode owner = node.getOwner();
|
||||||
|
|
||||||
for (int i = 0; i < parent.getChildCount(); i++) {
|
for (int i = 0; i < owner.getChildCount(); i++) {
|
||||||
if (parent.getChildAt(i).equals(node)) {
|
if (owner.getChildAt(i).equals(node)) {
|
||||||
parent.removeChildAt(i);
|
owner.removeChildAt(i);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -293,6 +286,8 @@ public class YogaLayout extends ViewGroup {
|
|||||||
if (view.getVisibility() == GONE) {
|
if (view.getVisibility() == GONE) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
int left = Math.round(xOffset + node.getLayoutX());
|
||||||
|
int top = Math.round(yOffset + node.getLayoutY());
|
||||||
view.measure(
|
view.measure(
|
||||||
View.MeasureSpec.makeMeasureSpec(
|
View.MeasureSpec.makeMeasureSpec(
|
||||||
Math.round(node.getLayoutWidth()),
|
Math.round(node.getLayoutWidth()),
|
||||||
@@ -300,11 +295,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
View.MeasureSpec.makeMeasureSpec(
|
View.MeasureSpec.makeMeasureSpec(
|
||||||
Math.round(node.getLayoutHeight()),
|
Math.round(node.getLayoutHeight()),
|
||||||
View.MeasureSpec.EXACTLY));
|
View.MeasureSpec.EXACTLY));
|
||||||
view.layout(
|
view.layout(left, top, left + view.getMeasuredWidth(), top + view.getMeasuredHeight());
|
||||||
Math.round(xOffset + node.getLayoutX()),
|
|
||||||
Math.round(yOffset + node.getLayoutY()),
|
|
||||||
Math.round(xOffset + node.getLayoutX() + node.getLayoutWidth()),
|
|
||||||
Math.round(yOffset + node.getLayoutY() + node.getLayoutHeight()));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
final int childrenCount = node.getChildCount();
|
final int childrenCount = node.getChildCount();
|
||||||
@@ -324,7 +315,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
protected void onLayout(boolean changed, int l, int t, int r, int b) {
|
||||||
// Either we are a root of a tree, or this function is called by our parent's onLayout, in which
|
// Either we are a root of a tree, or this function is called by our owner's onLayout, in which
|
||||||
// case our r-l and b-t are the size of our node.
|
// case our r-l and b-t are the size of our node.
|
||||||
if (!(getParent() instanceof YogaLayout)) {
|
if (!(getParent() instanceof YogaLayout)) {
|
||||||
createLayout(
|
createLayout(
|
||||||
@@ -708,7 +699,7 @@ public class YogaLayout extends ViewGroup {
|
|||||||
/**
|
/**
|
||||||
* Constructs a set of layout params, given width and height specs. In this case, we can set
|
* Constructs a set of layout params, given width and height specs. In this case, we can set
|
||||||
* the {@code yoga:width} and {@code yoga:height} if we are given them explicitly. If other
|
* the {@code yoga:width} and {@code yoga:height} if we are given them explicitly. If other
|
||||||
* options (such as {@code match_parent} or {@code wrap_content} are given, then the parent
|
* options (such as {@code match_owner} or {@code wrap_content} are given, then the owner
|
||||||
* LayoutParams will store them, and we deal with them during layout. (see
|
* LayoutParams will store them, and we deal with them during layout. (see
|
||||||
* {@link YogaLayout#createLayout})
|
* {@link YogaLayout#createLayout})
|
||||||
*
|
*
|
||||||
@@ -782,9 +773,9 @@ public class YogaLayout extends ViewGroup {
|
|||||||
* {@code View}'s measure function.
|
* {@code View}'s measure function.
|
||||||
*
|
*
|
||||||
* @param node The yoga node to measure
|
* @param node The yoga node to measure
|
||||||
* @param width The suggested width from the parent
|
* @param width The suggested width from the owner
|
||||||
* @param widthMode The type of suggestion for the width
|
* @param widthMode The type of suggestion for the width
|
||||||
* @param height The suggested height from the parent
|
* @param height The suggested height from the owner
|
||||||
* @param heightMode The type of suggestion for the height
|
* @param heightMode The type of suggestion for the height
|
||||||
* @return A measurement output ({@code YogaMeasureOutput}) for the node
|
* @return A measurement output ({@code YogaMeasureOutput}) for the node
|
||||||
*/
|
*/
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package com.facebook.yoga.android;
|
package com.facebook.yoga.android;
|
||||||
|
@@ -2,11 +2,9 @@
|
|||||||
|
|
||||||
<!--
|
<!--
|
||||||
Copyright (c) 2014-present, Facebook, Inc.
|
Copyright (c) 2014-present, Facebook, Inc.
|
||||||
All rights reserved.
|
|
||||||
|
|
||||||
This source code is licensed under the BSD-style license found in the
|
This source code is licensed under the MIT license found in the
|
||||||
LICENSE file in the root directory of this source tree. An additional grant
|
LICENSE file in the root directory of this source tree.
|
||||||
of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
-->
|
-->
|
||||||
|
|
||||||
<resources>
|
<resources>
|
||||||
|
@@ -1,13 +1,10 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) 2014-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
load("//:yoga_defs.bzl", "subdir_glob", "yoga_cxx_binary", "yoga_dep")
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
yoga_cxx_binary(
|
||||||
|
|
||||||
cxx_binary(
|
|
||||||
name = "benchmark",
|
name = "benchmark",
|
||||||
srcs = glob(["*.c"]),
|
srcs = glob(["*.c"]),
|
||||||
headers = subdir_glob([("", "*.h")]),
|
headers = subdir_glob([("", "*.h")]),
|
||||||
|
@@ -1,16 +1,76 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "YGBenchmark.h"
|
#include <math.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
#include <time.h>
|
||||||
|
|
||||||
#include <yoga/Yoga.h>
|
#include <yoga/Yoga.h>
|
||||||
|
|
||||||
|
#define NUM_REPETITIONS 1000
|
||||||
|
|
||||||
|
#define YGBENCHMARKS(BLOCK) \
|
||||||
|
int main(int argc, char const *argv[]) { \
|
||||||
|
clock_t __start; \
|
||||||
|
clock_t __endTimes[NUM_REPETITIONS]; \
|
||||||
|
{ BLOCK } \
|
||||||
|
return 0; \
|
||||||
|
}
|
||||||
|
|
||||||
|
#define YGBENCHMARK(NAME, BLOCK) \
|
||||||
|
__start = clock(); \
|
||||||
|
for (uint32_t __i = 0; __i < NUM_REPETITIONS; __i++) { \
|
||||||
|
{ BLOCK } \
|
||||||
|
__endTimes[__i] = clock(); \
|
||||||
|
} \
|
||||||
|
__printBenchmarkResult(NAME, __start, __endTimes);
|
||||||
|
|
||||||
|
static int __compareDoubles(const void *a, const void *b) {
|
||||||
|
double arg1 = *(const double *) a;
|
||||||
|
double arg2 = *(const double *) b;
|
||||||
|
|
||||||
|
if (arg1 < arg2) {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (arg1 > arg2) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __printBenchmarkResult(char *name, clock_t start, clock_t *endTimes) {
|
||||||
|
double timesInMs[NUM_REPETITIONS];
|
||||||
|
double mean = 0;
|
||||||
|
clock_t lastEnd = start;
|
||||||
|
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
||||||
|
timesInMs[i] = (endTimes[i] - lastEnd) / (double) CLOCKS_PER_SEC * 1000;
|
||||||
|
lastEnd = endTimes[i];
|
||||||
|
mean += timesInMs[i];
|
||||||
|
}
|
||||||
|
mean /= NUM_REPETITIONS;
|
||||||
|
|
||||||
|
qsort(timesInMs, NUM_REPETITIONS, sizeof(double), __compareDoubles);
|
||||||
|
double median = timesInMs[NUM_REPETITIONS / 2];
|
||||||
|
|
||||||
|
double variance = 0;
|
||||||
|
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
||||||
|
variance += pow(timesInMs[i] - mean, 2);
|
||||||
|
}
|
||||||
|
variance /= NUM_REPETITIONS;
|
||||||
|
double stddev = sqrt(variance);
|
||||||
|
|
||||||
|
printf("%s: median: %lf ms, stddev: %lf ms\n", name, median, stddev);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
static YGSize _measure(YGNodeRef node,
|
static YGSize _measure(YGNodeRef node,
|
||||||
float width,
|
float width,
|
||||||
YGMeasureMode widthMode,
|
YGMeasureMode widthMode,
|
||||||
@@ -99,7 +159,7 @@ YGBENCHMARKS({
|
|||||||
YGNodeStyleSetHeight(grandGrandChild, 10);
|
YGNodeStyleSetHeight(grandGrandChild, 10);
|
||||||
YGNodeInsertChild(grandChild, grandGrandChild, 0);
|
YGNodeInsertChild(grandChild, grandGrandChild, 0);
|
||||||
|
|
||||||
for (uint32_t iii = 0; iii < 10; iii++) {
|
for (uint32_t iiii = 0; iiii < 10; iiii++) {
|
||||||
const YGNodeRef grandGrandGrandChild = YGNodeNew();
|
const YGNodeRef grandGrandGrandChild = YGNodeNew();
|
||||||
YGNodeStyleSetFlexDirection(grandGrandGrandChild, YGFlexDirectionRow);
|
YGNodeStyleSetFlexDirection(grandGrandGrandChild, YGFlexDirectionRow);
|
||||||
YGNodeStyleSetFlexGrow(grandGrandGrandChild, 1);
|
YGNodeStyleSetFlexGrow(grandGrandGrandChild, 1);
|
||||||
|
@@ -1,73 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
|
||||||
* All rights reserved.
|
|
||||||
*
|
|
||||||
* This source code is licensed under the BSD-style license found in the
|
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include <stdint.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <time.h>
|
|
||||||
|
|
||||||
#define NUM_REPETITIONS 1000
|
|
||||||
|
|
||||||
#define YGBENCHMARKS(BLOCK) \
|
|
||||||
int main(int argc, char const *argv[]) { \
|
|
||||||
clock_t __start; \
|
|
||||||
clock_t __endTimes[NUM_REPETITIONS]; \
|
|
||||||
{ BLOCK } \
|
|
||||||
return 0; \
|
|
||||||
}
|
|
||||||
|
|
||||||
#define YGBENCHMARK(NAME, BLOCK) \
|
|
||||||
__start = clock(); \
|
|
||||||
for (uint32_t __i = 0; __i < NUM_REPETITIONS; __i++) { \
|
|
||||||
{ BLOCK } \
|
|
||||||
__endTimes[__i] = clock(); \
|
|
||||||
} \
|
|
||||||
__printBenchmarkResult(NAME, __start, __endTimes);
|
|
||||||
|
|
||||||
int __compareDoubles(const void *a, const void *b) {
|
|
||||||
double arg1 = *(const double *) a;
|
|
||||||
double arg2 = *(const double *) b;
|
|
||||||
|
|
||||||
if (arg1 < arg2) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (arg1 > arg2) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void __printBenchmarkResult(char *name, clock_t start, clock_t *endTimes) {
|
|
||||||
double timesInMs[NUM_REPETITIONS];
|
|
||||||
double mean = 0;
|
|
||||||
clock_t lastEnd = start;
|
|
||||||
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
|
||||||
timesInMs[i] = (endTimes[i] - lastEnd) / (double) CLOCKS_PER_SEC * 1000;
|
|
||||||
lastEnd = endTimes[i];
|
|
||||||
mean += timesInMs[i];
|
|
||||||
}
|
|
||||||
mean /= NUM_REPETITIONS;
|
|
||||||
|
|
||||||
qsort(timesInMs, NUM_REPETITIONS, sizeof(double), __compareDoubles);
|
|
||||||
double median = timesInMs[NUM_REPETITIONS / 2];
|
|
||||||
|
|
||||||
double variance = 0;
|
|
||||||
for (uint32_t i = 0; i < NUM_REPETITIONS; i++) {
|
|
||||||
variance += pow(timesInMs[i] - mean, 2);
|
|
||||||
}
|
|
||||||
variance /= NUM_REPETITIONS;
|
|
||||||
double stddev = sqrt(variance);
|
|
||||||
|
|
||||||
printf("%s: median: %lf ms, stddev: %lf ms\n", name, median, stddev);
|
|
||||||
}
|
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
80
csharp/BUCK
80
csharp/BUCK
@@ -1,11 +1,9 @@
|
|||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) 2014-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
include_defs("//YOGA_DEFS")
|
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "is_apple_platform", "yoga_cxx_library", "yoga_dep")
|
||||||
|
|
||||||
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
|
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
|
||||||
|
|
||||||
@@ -23,7 +21,7 @@ csharp_library(
|
|||||||
framework_ver = "net45",
|
framework_ver = "net45",
|
||||||
)
|
)
|
||||||
|
|
||||||
cxx_library(
|
yoga_cxx_library(
|
||||||
name = "yoganet",
|
name = "yoganet",
|
||||||
srcs = glob(["Yoga/YGInterop.cpp"]),
|
srcs = glob(["Yoga/YGInterop.cpp"]),
|
||||||
compiler_flags = COMPILER_FLAGS,
|
compiler_flags = COMPILER_FLAGS,
|
||||||
@@ -34,41 +32,41 @@ cxx_library(
|
|||||||
deps = [yoga_dep(":yoga")],
|
deps = [yoga_dep(":yoga")],
|
||||||
)
|
)
|
||||||
|
|
||||||
if isdir('/Applications/Xcode.app'):
|
if is_apple_platform():
|
||||||
yoganet_ios_srcs = []
|
yoganet_ios_srcs = []
|
||||||
for arch in [
|
for arch in [
|
||||||
'iphonesimulator-x86_64', 'iphonesimulator-i386', 'iphoneos-arm64', 'iphoneos-armv7'
|
"iphonesimulator-x86_64",
|
||||||
]:
|
"iphoneos-arm64",
|
||||||
name = 'yoganet-' + arch
|
]:
|
||||||
yoganet_ios_srcs.append(':' + name)
|
name = "yoganet-" + arch
|
||||||
|
yoganet_ios_srcs.append(":" + name)
|
||||||
|
genrule(
|
||||||
|
name = name,
|
||||||
|
srcs = [
|
||||||
|
yoga_dep(":yogaApple#%s,static" % arch),
|
||||||
|
yoga_dep("YogaKit:YogaKitApple#%s,static" % arch),
|
||||||
|
yoga_dep("csharp:yoganetApple#%s,static" % arch),
|
||||||
|
],
|
||||||
|
out = "libyoga-%s.a" % arch,
|
||||||
|
cmd = "libtool -static -o $OUT $SRCS",
|
||||||
|
visibility = [yoga_dep("csharp:yoganet-ios")],
|
||||||
|
)
|
||||||
|
|
||||||
genrule(
|
genrule(
|
||||||
name = name,
|
name = "yoganet-ios",
|
||||||
srcs = [
|
srcs = yoganet_ios_srcs,
|
||||||
yoga_dep(':yoga#%s,static' % arch),
|
out = "libyoga.a",
|
||||||
yoga_dep('YogaKit:YogaKit#%s,static' % arch),
|
cmd = "lipo $SRCS -create -output $OUT",
|
||||||
yoga_dep('csharp:yoganet#%s,static' % arch),
|
visibility = ["PUBLIC"],
|
||||||
],
|
|
||||||
out = 'libyoga-%s.a' % arch,
|
|
||||||
cmd = 'libtool -static -o $OUT $SRCS',
|
|
||||||
visibility = [yoga_dep('csharp:yoganet-ios')],
|
|
||||||
)
|
)
|
||||||
|
|
||||||
genrule(
|
yoganet_macosx_target = "csharp:yoganetAppleMac#macosx-%s,dynamic"
|
||||||
name = 'yoganet-ios',
|
genrule(
|
||||||
srcs = yoganet_ios_srcs,
|
name = "yoganet-macosx",
|
||||||
out = 'libyoga.a',
|
srcs = [
|
||||||
cmd = 'lipo $SRCS -create -output $OUT',
|
yoga_dep(yoganet_macosx_target % "x86_64"),
|
||||||
visibility = ['PUBLIC'],
|
],
|
||||||
)
|
out = "libyoga.dylib",
|
||||||
|
cmd = "lipo $SRCS -create -output $OUT",
|
||||||
yoganet_macosx_target = 'csharp:yoganet#macosx-%s,dynamic'
|
visibility = ["PUBLIC"],
|
||||||
genrule(
|
)
|
||||||
name = 'yoganet-macosx',
|
|
||||||
srcs = [
|
|
||||||
yoga_dep(yoganet_macosx_target % 'x86_64'),
|
|
||||||
yoga_dep(yoganet_macosx_target % 'i386'),
|
|
||||||
],
|
|
||||||
out = 'libyoga.dylib',
|
|
||||||
cmd = 'lipo $SRCS -create -output $OUT',
|
|
||||||
visibility = ['PUBLIC'],
|
|
||||||
)
|
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
@@ -16,5 +14,6 @@ namespace Facebook.Yoga
|
|||||||
FlexEnd,
|
FlexEnd,
|
||||||
SpaceBetween,
|
SpaceBetween,
|
||||||
SpaceAround,
|
SpaceAround,
|
||||||
|
SpaceEvenly,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
# Copyright (c) 2014-present, Facebook, Inc.
|
# Copyright (c) 2014-present, Facebook, Inc.
|
||||||
# All rights reserved.
|
|
||||||
#
|
#
|
||||||
# This source code is licensed under the BSD-style license found in the
|
# This source code is licensed under the MIT license found in the
|
||||||
# LICENSE file in the root directory of this source tree. An additional grant
|
# LICENSE file in the root directory of this source tree.
|
||||||
# of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System.Reflection;
|
using System.Reflection;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "YGInterop.h"
|
#include "YGInterop.h"
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@@ -227,19 +227,31 @@
|
|||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="..\..\yoga\Yoga.h" />
|
<ClInclude Include="..\..\yoga\Utils.h" />
|
||||||
|
<ClInclude Include="..\..\yoga\YGConfig.h" />
|
||||||
<ClInclude Include="..\..\yoga\YGEnums.h" />
|
<ClInclude Include="..\..\yoga\YGEnums.h" />
|
||||||
|
<ClInclude Include="..\..\yoga\YGFloatOptional.h" />
|
||||||
|
<ClInclude Include="..\..\yoga\YGLayout.h" />
|
||||||
<ClInclude Include="..\..\yoga\YGMacros.h" />
|
<ClInclude Include="..\..\yoga\YGMacros.h" />
|
||||||
<ClInclude Include="..\..\yoga\YGNodeList.h" />
|
<ClInclude Include="..\..\yoga\YGNode.h" />
|
||||||
|
<ClInclude Include="..\..\yoga\YGNodePrint.h" />
|
||||||
|
<ClInclude Include="..\..\yoga\YGStyle.h" />
|
||||||
|
<ClInclude Include="..\..\yoga\Yoga-internal.h" />
|
||||||
|
<ClInclude Include="..\..\yoga\Yoga.h" />
|
||||||
<ClInclude Include="resource.h" />
|
<ClInclude Include="resource.h" />
|
||||||
<ClInclude Include="YGInterop.h" />
|
|
||||||
<ClInclude Include="stdafx.h" />
|
<ClInclude Include="stdafx.h" />
|
||||||
<ClInclude Include="targetver.h" />
|
<ClInclude Include="targetver.h" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="..\..\yoga\Yoga.c" />
|
<ClCompile Include="..\..\yoga\Utils.cpp" />
|
||||||
<ClCompile Include="..\..\yoga\YGEnums.c" />
|
<ClCompile Include="..\..\yoga\YGConfig.cpp" />
|
||||||
<ClCompile Include="..\..\yoga\YGNodeList.c" />
|
<ClCompile Include="..\..\yoga\YGEnums.cpp" />
|
||||||
|
<ClCompile Include="..\..\yoga\YGFloatOptional.cpp" />
|
||||||
|
<ClCompile Include="..\..\yoga\YGLayout.cpp" />
|
||||||
|
<ClCompile Include="..\..\yoga\YGNode.cpp" />
|
||||||
|
<ClCompile Include="..\..\yoga\YGNodePrint.cpp" />
|
||||||
|
<ClCompile Include="..\..\yoga\YGStyle.cpp" />
|
||||||
|
<ClCompile Include="..\..\yoga\Yoga.cpp" />
|
||||||
<ClCompile Include="YGInterop.cpp" />
|
<ClCompile Include="YGInterop.cpp" />
|
||||||
<ClCompile Include="dllmain.cpp">
|
<ClCompile Include="dllmain.cpp">
|
||||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
|
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
|
||||||
|
@@ -21,19 +21,40 @@
|
|||||||
<ClInclude Include="targetver.h">
|
<ClInclude Include="targetver.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\yoga\Yoga.h">
|
<ClInclude Include="resource.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\yoga\Utils.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\yoga\YGEnums.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\yoga\YGFloatOptional.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\yoga\YGLayout.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\yoga\YGMacros.h">
|
<ClInclude Include="..\..\yoga\YGMacros.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\..\yoga\YGNodeList.h">
|
<ClInclude Include="..\..\yoga\YGNode.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="YGInterop.h">
|
<ClInclude Include="..\..\yoga\YGNodePrint.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="resource.h">
|
<ClInclude Include="..\..\yoga\YGStyle.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\yoga\Yoga.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\yoga\Yoga-internal.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\..\yoga\YGConfig.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@@ -44,15 +65,36 @@
|
|||||||
<ClCompile Include="dllmain.cpp">
|
<ClCompile Include="dllmain.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\..\yoga\Yoga.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="..\..\yoga\YGNodeList.c">
|
|
||||||
<Filter>Source Files</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
<ClCompile Include="YGInterop.cpp">
|
<ClCompile Include="YGInterop.cpp">
|
||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\yoga\Utils.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\yoga\YGEnums.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\yoga\YGFloatOptional.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\yoga\YGLayout.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\yoga\YGNode.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\yoga\YGNodePrint.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\yoga\YGStyle.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\yoga\Yoga.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\..\yoga\YGConfig.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="Yoga.rc">
|
<ResourceCompile Include="Yoga.rc">
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// dllmain.cpp : Defines the entry point for the DLL application.
|
// dllmain.cpp : Defines the entry point for the DLL application.
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// stdafx.cpp : source file that includes just the standard includes
|
// stdafx.cpp : source file that includes just the standard includes
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// stdafx.h : include file for standard system include files,
|
// stdafx.h : include file for standard system include files,
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
cd `dirname "$0"`
|
cd `dirname "$0"`
|
||||||
echo $ANDROID_SDK
|
echo $ANDROID_SDK
|
||||||
BUCK_RELEASE=2017.05.09.01
|
BUCK_RELEASE=2018.02.16.01
|
||||||
echo "buck $BUCK_RELEASE"
|
echo "buck $BUCK_RELEASE"
|
||||||
BUCK=lib/buck-$BUCK_RELEASE/bin/buck
|
BUCK=lib/buck-$BUCK_RELEASE/bin/buck
|
||||||
if $BUCK --version >/dev/null 2>&1; then true; else
|
if $BUCK --version >/dev/null 2>&1; then true; else
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,9 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE-examples file in the root directory of this source tree.
|
* LICENSE file in the root directory of this source tree.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAbsolutePositionTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignContentTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignItemsTest.html
|
||||||
@@ -1958,5 +1956,211 @@ namespace Facebook.Yoga
|
|||||||
Assert.AreEqual(20f, root_child0_child0_child0.LayoutHeight);
|
Assert.AreEqual(20f, root_child0_child0_child0.LayoutHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_align_flex_start_with_shrinking_children()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.Width = 500;
|
||||||
|
root.Height = 500;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root_child0.AlignItems = YogaAlign.FlexStart;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0.FlexGrow = 1;
|
||||||
|
root_child0_child0.FlexShrink = 1;
|
||||||
|
root_child0.Insert(0, root_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child0.FlexGrow = 1;
|
||||||
|
root_child0_child0_child0.FlexShrink = 1;
|
||||||
|
root_child0_child0.Insert(0, root_child0_child0_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(500f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(500f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(500f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_align_flex_start_with_stretching_children()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.Width = 500;
|
||||||
|
root.Height = 500;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0.FlexGrow = 1;
|
||||||
|
root_child0_child0.FlexShrink = 1;
|
||||||
|
root_child0.Insert(0, root_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child0.FlexGrow = 1;
|
||||||
|
root_child0_child0_child0.FlexShrink = 1;
|
||||||
|
root_child0_child0.Insert(0, root_child0_child0_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(500f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(500f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_align_flex_start_with_shrinking_children_with_stretch()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.Width = 500;
|
||||||
|
root.Height = 500;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root_child0.AlignItems = YogaAlign.FlexStart;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0.FlexGrow = 1;
|
||||||
|
root_child0_child0.FlexShrink = 1;
|
||||||
|
root_child0.Insert(0, root_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child0.FlexGrow = 1;
|
||||||
|
root_child0_child0_child0.FlexShrink = 1;
|
||||||
|
root_child0_child0.Insert(0, root_child0_child0_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(500f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(500f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(500f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(500f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAlignSelfTest.html
|
||||||
|
299
csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs
Normal file
299
csharp/tests/Facebook.Yoga/YGAndroidNewsFeed.cs
Normal file
@@ -0,0 +1,299 @@
|
|||||||
|
/**
|
||||||
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
|
*
|
||||||
|
* This source code is licensed under the MIT license found in the
|
||||||
|
* LICENSE file in the root directory of this source tree.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGAndroidNewsFeed.html
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace Facebook.Yoga
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class YGAndroidNewsFeed
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void Test_android_news_feed()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.AlignContent = YogaAlign.Stretch;
|
||||||
|
root.Width = 1080;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0.Insert(0, root_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0.Insert(0, root_child0_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child0_child0.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root_child0_child0_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child0_child0.AlignItems = YogaAlign.FlexStart;
|
||||||
|
root_child0_child0_child0_child0.MarginStart = 36;
|
||||||
|
root_child0_child0_child0_child0.MarginTop = 24;
|
||||||
|
root_child0_child0_child0.Insert(0, root_child0_child0_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child0_child0_child0.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root_child0_child0_child0_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child0_child0.Insert(0, root_child0_child0_child0_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0_child0_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child0_child0_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child0_child0_child0_child0.Width = 120;
|
||||||
|
root_child0_child0_child0_child0_child0_child0.Height = 120;
|
||||||
|
root_child0_child0_child0_child0_child0.Insert(0, root_child0_child0_child0_child0_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0_child0_child1 = new YogaNode(config);
|
||||||
|
root_child0_child0_child0_child0_child1.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child0_child0_child1.FlexShrink = 1;
|
||||||
|
root_child0_child0_child0_child0_child1.MarginRight = 36;
|
||||||
|
root_child0_child0_child0_child0_child1.PaddingLeft = 36;
|
||||||
|
root_child0_child0_child0_child0_child1.PaddingTop = 21;
|
||||||
|
root_child0_child0_child0_child0_child1.PaddingRight = 36;
|
||||||
|
root_child0_child0_child0_child0_child1.PaddingBottom = 18;
|
||||||
|
root_child0_child0_child0_child0.Insert(1, root_child0_child0_child0_child0_child1);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0_child0_child1_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child0_child0_child1_child0.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root_child0_child0_child0_child0_child1_child0.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child0_child0_child1_child0.FlexShrink = 1;
|
||||||
|
root_child0_child0_child0_child0_child1.Insert(0, root_child0_child0_child0_child0_child1_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0_child0_child1_child1 = new YogaNode(config);
|
||||||
|
root_child0_child0_child0_child0_child1_child1.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child0_child0_child1_child1.FlexShrink = 1;
|
||||||
|
root_child0_child0_child0_child0_child1.Insert(1, root_child0_child0_child0_child0_child1_child1);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child1 = new YogaNode(config);
|
||||||
|
root_child0_child0_child1.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0.Insert(1, root_child0_child0_child1);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child1_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child1_child0.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root_child0_child0_child1_child0.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child1_child0.AlignItems = YogaAlign.FlexStart;
|
||||||
|
root_child0_child0_child1_child0.MarginStart = 174;
|
||||||
|
root_child0_child0_child1_child0.MarginTop = 24;
|
||||||
|
root_child0_child0_child1.Insert(0, root_child0_child0_child1_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child1_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child1_child0_child0.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root_child0_child0_child1_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child1_child0.Insert(0, root_child0_child0_child1_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child1_child0_child0_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child1_child0_child0_child0.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child1_child0_child0_child0.Width = 72;
|
||||||
|
root_child0_child0_child1_child0_child0_child0.Height = 72;
|
||||||
|
root_child0_child0_child1_child0_child0.Insert(0, root_child0_child0_child1_child0_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child1_child0_child1 = new YogaNode(config);
|
||||||
|
root_child0_child0_child1_child0_child1.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child1_child0_child1.FlexShrink = 1;
|
||||||
|
root_child0_child0_child1_child0_child1.MarginRight = 36;
|
||||||
|
root_child0_child0_child1_child0_child1.PaddingLeft = 36;
|
||||||
|
root_child0_child0_child1_child0_child1.PaddingTop = 21;
|
||||||
|
root_child0_child0_child1_child0_child1.PaddingRight = 36;
|
||||||
|
root_child0_child0_child1_child0_child1.PaddingBottom = 18;
|
||||||
|
root_child0_child0_child1_child0.Insert(1, root_child0_child0_child1_child0_child1);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child1_child0_child1_child0 = new YogaNode(config);
|
||||||
|
root_child0_child0_child1_child0_child1_child0.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root_child0_child0_child1_child0_child1_child0.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child1_child0_child1_child0.FlexShrink = 1;
|
||||||
|
root_child0_child0_child1_child0_child1.Insert(0, root_child0_child0_child1_child0_child1_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child1_child0_child1_child1 = new YogaNode(config);
|
||||||
|
root_child0_child0_child1_child0_child1_child1.AlignContent = YogaAlign.Stretch;
|
||||||
|
root_child0_child0_child1_child0_child1_child1.FlexShrink = 1;
|
||||||
|
root_child0_child0_child1_child0_child1.Insert(1, root_child0_child0_child1_child0_child1_child1);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(1080f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(240f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(1080f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(240f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(1080f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(240f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(1080f, root_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(144f, root_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(24f, root_child0_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(1044f, root_child0_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1.LayoutY);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child0_child0_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(39f, root_child0_child0_child0_child0_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child0_child0_child1_child0.LayoutX);
|
||||||
|
Assert.AreEqual(21f, root_child0_child0_child0_child0_child1_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child0_child0_child1_child1.LayoutX);
|
||||||
|
Assert.AreEqual(21f, root_child0_child0_child0_child0_child1_child1.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1.LayoutX);
|
||||||
|
Assert.AreEqual(144f, root_child0_child0_child1.LayoutY);
|
||||||
|
Assert.AreEqual(1080f, root_child0_child0_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(96f, root_child0_child0_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(174f, root_child0_child0_child1_child0.LayoutX);
|
||||||
|
Assert.AreEqual(24f, root_child0_child0_child1_child0.LayoutY);
|
||||||
|
Assert.AreEqual(906f, root_child0_child0_child1_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1.LayoutY);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(39f, root_child0_child0_child1_child0_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child1_child0_child1_child0.LayoutX);
|
||||||
|
Assert.AreEqual(21f, root_child0_child0_child1_child0_child1_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child1_child0_child1_child1.LayoutX);
|
||||||
|
Assert.AreEqual(21f, root_child0_child0_child1_child0_child1_child1.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child1.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(1080f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(240f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(1080f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(240f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(1080f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(240f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(1080f, root_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(144f, root_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(24f, root_child0_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(1044f, root_child0_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(924f, root_child0_child0_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(120f, root_child0_child0_child0_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(816f, root_child0_child0_child0_child0_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1.LayoutY);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child0_child0_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(39f, root_child0_child0_child0_child0_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child0_child0_child1_child0.LayoutX);
|
||||||
|
Assert.AreEqual(21f, root_child0_child0_child0_child0_child1_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child0_child0_child1_child1.LayoutX);
|
||||||
|
Assert.AreEqual(21f, root_child0_child0_child0_child0_child1_child1.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child0_child0_child1_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1.LayoutX);
|
||||||
|
Assert.AreEqual(144f, root_child0_child0_child1.LayoutY);
|
||||||
|
Assert.AreEqual(1080f, root_child0_child0_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(96f, root_child0_child0_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0.LayoutX);
|
||||||
|
Assert.AreEqual(24f, root_child0_child0_child1_child0.LayoutY);
|
||||||
|
Assert.AreEqual(906f, root_child0_child0_child1_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(834f, root_child0_child0_child1_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(726f, root_child0_child0_child1_child0_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1.LayoutY);
|
||||||
|
Assert.AreEqual(72f, root_child0_child0_child1_child0_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(39f, root_child0_child0_child1_child0_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child1_child0_child1_child0.LayoutX);
|
||||||
|
Assert.AreEqual(21f, root_child0_child0_child1_child0_child1_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child1_child0_child1_child1.LayoutX);
|
||||||
|
Assert.AreEqual(21f, root_child0_child0_child1_child0_child1_child1.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0_child1_child0_child1_child1.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGBorderTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGDimensionTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGDisplayTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexDirectionTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGFlexWrapTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGJustifyContentTest.html
|
||||||
@@ -375,6 +373,7 @@ namespace Facebook.Yoga
|
|||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode(config);
|
YogaNode root_child1 = new YogaNode(config);
|
||||||
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode(config);
|
YogaNode root_child2 = new YogaNode(config);
|
||||||
@@ -396,10 +395,10 @@ namespace Facebook.Yoga
|
|||||||
Assert.AreEqual(0f, root_child1.LayoutX);
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
Assert.AreEqual(10f, root_child1.LayoutY);
|
Assert.AreEqual(10f, root_child1.LayoutY);
|
||||||
Assert.AreEqual(102f, root_child1.LayoutWidth);
|
Assert.AreEqual(102f, root_child1.LayoutWidth);
|
||||||
Assert.AreEqual(0f, root_child1.LayoutHeight);
|
Assert.AreEqual(10f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
Assert.AreEqual(0f, root_child2.LayoutX);
|
Assert.AreEqual(0f, root_child2.LayoutX);
|
||||||
Assert.AreEqual(10f, root_child2.LayoutY);
|
Assert.AreEqual(20f, root_child2.LayoutY);
|
||||||
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
||||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||||
|
|
||||||
@@ -419,10 +418,10 @@ namespace Facebook.Yoga
|
|||||||
Assert.AreEqual(0f, root_child1.LayoutX);
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
Assert.AreEqual(10f, root_child1.LayoutY);
|
Assert.AreEqual(10f, root_child1.LayoutY);
|
||||||
Assert.AreEqual(102f, root_child1.LayoutWidth);
|
Assert.AreEqual(102f, root_child1.LayoutWidth);
|
||||||
Assert.AreEqual(0f, root_child1.LayoutHeight);
|
Assert.AreEqual(10f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
Assert.AreEqual(0f, root_child2.LayoutX);
|
Assert.AreEqual(0f, root_child2.LayoutX);
|
||||||
Assert.AreEqual(10f, root_child2.LayoutY);
|
Assert.AreEqual(20f, root_child2.LayoutY);
|
||||||
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
||||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||||
}
|
}
|
||||||
@@ -699,5 +698,310 @@ namespace Facebook.Yoga
|
|||||||
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_justify_content_row_min_width_and_margin()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.JustifyContent = YogaJustify.Center;
|
||||||
|
root.MarginLeft = 100;
|
||||||
|
root.MinWidth = 50;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root_child0.Width = 20;
|
||||||
|
root_child0.Height = 20;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(100f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(15f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(100f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(15f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_justify_content_row_max_width_and_margin()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.JustifyContent = YogaJustify.Center;
|
||||||
|
root.MarginLeft = 100;
|
||||||
|
root.Width = 100;
|
||||||
|
root.MaxWidth = 80;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root_child0.Width = 20;
|
||||||
|
root_child0.Height = 20;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(100f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(80f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(30f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(100f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(80f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(30f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_justify_content_column_min_height_and_margin()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.JustifyContent = YogaJustify.Center;
|
||||||
|
root.MarginTop = 100;
|
||||||
|
root.MinHeight = 50;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root_child0.Width = 20;
|
||||||
|
root_child0.Height = 20;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(100f, root.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(15f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(100f, root.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(15f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_justify_content_colunn_max_height_and_margin()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.JustifyContent = YogaJustify.Center;
|
||||||
|
root.MarginTop = 100;
|
||||||
|
root.Height = 100;
|
||||||
|
root.MaxHeight = 80;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root_child0.Width = 20;
|
||||||
|
root_child0.Height = 20;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(100f, root.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(80f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(30f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(100f, root.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(80f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(30f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_justify_content_column_space_evenly()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.JustifyContent = YogaJustify.SpaceEvenly;
|
||||||
|
root.Width = 102;
|
||||||
|
root.Height = 102;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root_child0.Height = 10;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode(config);
|
||||||
|
root_child1.Height = 10;
|
||||||
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
|
YogaNode root_child2 = new YogaNode(config);
|
||||||
|
root_child2.Height = 10;
|
||||||
|
root.Insert(2, root_child2);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(102f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(102f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(18f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(102f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(46f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(102f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child2.LayoutX);
|
||||||
|
Assert.AreEqual(74f, root_child2.LayoutY);
|
||||||
|
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(102f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(102f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(18f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(102f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(46f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(102f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child2.LayoutX);
|
||||||
|
Assert.AreEqual(74f, root_child2.LayoutY);
|
||||||
|
Assert.AreEqual(102f, root_child2.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_justify_content_row_space_evenly()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.JustifyContent = YogaJustify.SpaceEvenly;
|
||||||
|
root.Width = 102;
|
||||||
|
root.Height = 102;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root_child0.Height = 10;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode(config);
|
||||||
|
root_child1.Height = 10;
|
||||||
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
|
YogaNode root_child2 = new YogaNode(config);
|
||||||
|
root_child2.Height = 10;
|
||||||
|
root.Insert(2, root_child2);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(102f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(102f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(26f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(51f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(77f, root_child2.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child2.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child2.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(102f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(102f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(77f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(51f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(26f, root_child2.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child2.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child2.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child2.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGMarginTest.html
|
||||||
@@ -1607,5 +1605,121 @@ namespace Facebook.Yoga
|
|||||||
Assert.AreEqual(72f, root_child0.LayoutHeight);
|
Assert.AreEqual(72f, root_child0.LayoutHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_margin_auto_top_stretching_child()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.AlignItems = YogaAlign.Center;
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexShrink = 1;
|
||||||
|
root_child0.FlexBasis = 0.Percent();
|
||||||
|
root_child0.MarginTop = YogaValue.Auto();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode(config);
|
||||||
|
root_child1.Width = 50;
|
||||||
|
root_child1.Height = 50;
|
||||||
|
root.Insert(1, root_child1);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(150f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(75f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(150f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(150f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(75f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(150f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_margin_auto_left_stretching_child()
|
||||||
|
{
|
||||||
|
YogaConfig config = new YogaConfig();
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode(config);
|
||||||
|
root.AlignItems = YogaAlign.Center;
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode(config);
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexShrink = 1;
|
||||||
|
root_child0.FlexBasis = 0.Percent();
|
||||||
|
root_child0.MarginLeft = YogaValue.Auto();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode(config);
|
||||||
|
root_child1.Width = 50;
|
||||||
|
root_child1.Height = 50;
|
||||||
|
root.Insert(1, root_child1);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(150f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(75f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(150f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(150f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(75f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(150f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGMinMaxDimensionTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGPaddingTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html
|
||||||
|
@@ -1,10 +1,8 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
|
||||||
*
|
*
|
||||||
* This source code is licensed under the BSD-style license found in the
|
* This source code is licensed under the MIT license found in the
|
||||||
* LICENSE file in the root directory of this source tree. An additional grant
|
* LICENSE file in the root directory of this source tree.
|
||||||
* of patent rights can be found in the PATENTS file in the same directory.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// @Generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGRoundingTest.html
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user