Compare commits

..

1 Commits

Author SHA1 Message Date
yxping
8bea26d0a0 Fix test failure about zero_size_with_child
A test about parent has zero width and height can not pass.
2018-03-30 15:12:50 +08:00
463 changed files with 20271 additions and 16225 deletions

View File

@@ -1,56 +0,0 @@
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: AlwaysBreak
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Left
AlignOperands: false
AlignTrailingComments: false
AllowAllParametersOfDeclarationOnNextLine: false
AllowShortBlocksOnASingleLine: false
AllowShortCaseLabelsOnASingleLine: false
AllowShortFunctionsOnASingleLine: Empty
AllowShortIfStatementsOnASingleLine: false
AllowShortLoopsOnASingleLine: true
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: true
AlwaysBreakTemplateDeclarations: Yes
BinPackArguments: false
BinPackParameters: false
BreakBeforeBinaryOperators: false
BreakBeforeBraces: Attach
BreakBeforeTernaryOperators: true
BreakConstructorInitializers: BeforeColon
BreakInheritanceList: BeforeColon
BreakStringLiterals: true
ColumnLimit: 80
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: false
FixNamespaceComments: true
IndentCaseLabels: true
IndentPPDirectives: None
IndentWidth: 2
IndentWrappedFunctionNames: false
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
PenaltyReturnTypeOnItsOwnLine: 2000
PointerAlignment: Left
ReflowComments: true
SortIncludes: false
SortUsingDeclarations: true
SpaceAfterCStyleCast: true
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
Standard: Cpp11
UseTab: Never

View File

@@ -1 +0,0 @@
^lib/.*

View File

@@ -1,66 +1,16 @@
language: java
os: linux
addons:
apt:
sources:
- llvm-toolchain-trusty-6.0
- ubuntu-toolchain-r-test
packages:
- clang-6.0
env:
- TARGET: website
- TARGET: android
language: node_js
node_js:
- "8"
install:
- cd website
- yarn --ignore-scripts
- cd ..
cache:
directories:
- $HOME/buck
- $HOME/.gradle
before_install:
- |
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;
fi
# Android
- |
if [[ $TARGET = "android" ]]; then
pushd $HOME
git clone --depth 1 https://github.com/facebook/buck.git
cd buck
ant
popd
export PATH=$PATH:$HOME/buck/bin/
buck --version
export TERMINAL=dumb
source scripts/android-setup.sh && installAndroidSDK
export ANDROID_SDK=$ANDROID_HOME
export ANDROID_NDK_REPOSITORY=$HOME/android-ndk
export ANDROID_NDK_HOME=$ANDROID_NDK_REPOSITORY/android-ndk-r15c
fi
# Website
- |
if [[ $TARGET = "website" ]]; then
nvm install 8
nvm use 8
fi
script:
- |
if [[ $TARGET = "android" ]]; then
./gradlew testDebugUnit && scripts/publish-snapshot.sh
fi
- |
if [[ $TARGET = "website" ]]; then
pushd website
yarn build
popd
fi
- cd website
- yarn build
- cd ..
deploy:
provider: pages
@@ -73,4 +23,3 @@ deploy:
keep-history: true
on:
branch: master
condition: $TARGET = website

24
BUCK
View File

@@ -1,8 +1,9 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
load("//tools/build_defs/oss:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "LIBRARY_COMPILER_FLAGS", "subdir_glob", "yoga_cxx_library", "yoga_cxx_test", "yoga_dep")
load("//:yoga_defs.bzl", "LIBRARY_COMPILER_FLAGS", "BASE_COMPILER_FLAGS", "GTEST_TARGET", "yoga_dep", "cxx_library", "cxx_test")
GMOCK_OVERRIDE_FLAGS = [
# gmock does not mark mocked methods as override, ignore the warnings in tests
@@ -17,7 +18,7 @@ TEST_COMPILER_FLAGS = BASE_COMPILER_FLAGS + GMOCK_OVERRIDE_FLAGS + [
"-std=c++1y",
]
yoga_cxx_library(
cxx_library(
name = "yoga",
srcs = glob(["yoga/*.cpp"]),
header_namespace = "",
@@ -31,10 +32,23 @@ yoga_cxx_library(
],
)
yoga_cxx_test(
cxx_library(
name = "yogafastmath",
srcs = glob(["yoga/*.cpp"]),
header_namespace = "",
exported_headers = subdir_glob([("", "yoga/*.h")]),
compiler_flags = COMPILER_FLAGS + ["-ffast-math"],
soname = "libyogafastmathcore.$(ext)",
tests = [":YogaTests"],
visibility = ["PUBLIC"],
deps = [
yoga_dep("lib/fb:ndklog"),
],
)
cxx_test(
name = "YogaTests",
srcs = glob(["tests/*.cpp"]),
headers = subdir_glob([("", "yoga/**/*.h")]),
compiler_flags = TEST_COMPILER_FLAGS,
contacts = ["emilsj@fb.com"],
visibility = ["PUBLIC"],

View File

@@ -1,5 +1,5 @@
#
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.

View File

@@ -1,3 +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.fb.com/codeofconduct/) so that you can understand what actions will and will not be tolerated.
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.

View File

@@ -4,7 +4,7 @@ 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.fb.com/codeofconduct/) so that you can understand what actions will and will not be tolerated.
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
We actively welcome your pull requests.

View File

@@ -1,6 +1,6 @@
MIT License
Copyright (c) Facebook, Inc. and its affiliates.
Copyright (c) 2014-present, Facebook, Inc.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@@ -8,7 +8,7 @@ For testing we rely on [gtest](https://github.com/google/googletest) as a submod
For any changes you make you should ensure that all the tests are passing. In case you make any fixes or additions to the library please also add tests for that change to ensure we don't break anything in the future. Tests are located in the `tests` directory. Run the tests by executing `buck test //:yoga`.
Instead of manually writing a test which ensures parity with web implementations of Flexbox you can run `gentest/gentest.rb` to generate a test for you. You can write html which you want to verify in Yoga, in `gentest/fixtures` folder, such as the following.
Instead of manually writing a test which ensures parity with web implementations of Flexbox you can run `gentest/gentest.rb` to generated a test for you. You can write html which you want to verify in Yoga, in `gentest/fixtures` folder, such as the following.
```html
<div id="my_test" style="width: 100px; height: 100px; align-items: center;">

View File

@@ -1,12 +1,6 @@
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE
# file in the root directory of this source tree.
#
Pod::Spec.new do |spec|
spec.name = 'Yoga'
spec.version = '1.12.0-pre.1'
spec.version = '1.8.0'
spec.license = { :type => 'MIT', :file => "LICENSE" }
spec.homepage = 'https://yogalayout.com/'
spec.documentation_url = 'https://yogalayout.com/docs'
@@ -17,14 +11,11 @@ Pod::Spec.new do |spec|
spec.authors = 'Facebook'
spec.source = {
:git => 'https://github.com/facebook/yoga.git',
:tag => spec.version.to_s,
:tag => '1.8.0',
}
spec.platforms = { :ios => "4.3", :osx => "10.7", :tvos => "10.0", :watchos => "2.0" }
spec.osx.deployment_target = '10.13'
spec.module_name = 'yoga'
spec.requires_arc = false
spec.pod_target_xcconfig = {
'DEFINES_MODULE' => 'YES'
}
spec.compiler_flags = [
'-fno-omit-frame-pointer',
'-fexceptions',
@@ -34,6 +25,6 @@ Pod::Spec.new do |spec|
'-fPIC'
]
spec.source_files = 'yoga/**/*.{c,h,cpp}'
spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros,YGValue}.h'
spec.public_header_files = 'yoga/{Yoga,YGEnums,YGMacros}.h'
end

View File

@@ -1,12 +1,6 @@
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE
# file in the root directory of this source tree.
#
podspec = Pod::Spec.new do |spec|
spec.name = 'YogaKit'
spec.version = '1.12.0'
spec.version = '1.7.0'
spec.license = { :type => 'MIT', :file => "LICENSE" }
spec.homepage = 'https://facebook.github.io/yoga/'
spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/yogakit/'
@@ -17,18 +11,17 @@ podspec = Pod::Spec.new do |spec|
spec.authors = 'Facebook'
spec.source = {
:git => 'https://github.com/facebook/yoga.git',
:tag => spec.version.to_s,
:tag => '1.7.0',
}
spec.platform = :ios
spec.ios.deployment_target = '8.0'
spec.ios.frameworks = 'UIKit'
spec.dependency 'Yoga', '~> 1.9'
spec.dependency 'Yoga', '~> 1.7'
spec.source_files = 'YogaKit/Source/*.{h,m,swift}'
spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h'
spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h'
spec.swift_version = '3.0'
end
# See https://github.com/facebook/yoga/pull/366

View File

@@ -1,8 +1,9 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
load("//tools/build_defs/oss:yoga_defs.bzl", "subdir_glob", "yoga_apple_library", "yoga_apple_test", "yoga_dep")
load("//:yoga_defs.bzl", "yoga_dep", "apple_library", "apple_test")
COMPILER_FLAGS = [
"-fobjc-arc",
@@ -24,7 +25,7 @@ COMPILER_FLAGS = [
"-Wunused-value",
]
yoga_apple_library(
apple_library(
name = "YogaKit",
srcs = glob(["Source/**/*.m"]),
header_namespace = "",
@@ -48,7 +49,7 @@ yoga_apple_library(
],
)
yoga_apple_test(
apple_test(
name = "YogaKitTests",
srcs = glob(["Tests/**/*.m"]),
compiler_flags = COMPILER_FLAGS,

View File

@@ -1,9 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "YGLayout.h"
#import <UIKit/UIKit.h>

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,9 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "YGLayout.h"
#import <yoga/Yoga.h>

View File

@@ -1,9 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#import <UIKit/UIKit.h>
#import <yoga/YGEnums.h>
#import <yoga/Yoga.h>
@@ -32,13 +33,6 @@ typedef NS_OPTIONS(NSInteger, YGDimensionFlexibility) {
- (instancetype)init
__attribute__((unavailable("you are not meant to initialise YGLayout")));
/**
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)new
__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.
@@ -62,7 +56,6 @@ typedef NS_OPTIONS(NSInteger, YGDimensionFlexibility) {
@property (nonatomic, readwrite, assign) YGOverflow overflow;
@property (nonatomic, readwrite, assign) YGDisplay display;
@property (nonatomic, readwrite, assign) CGFloat flex;
@property (nonatomic, readwrite, assign) CGFloat flexGrow;
@property (nonatomic, readwrite, assign) CGFloat flexShrink;
@property (nonatomic, readwrite, assign) YGValue flexBasis;

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
@@ -129,7 +129,6 @@ static YGConfigRef globalConfig;
@interface YGLayout ()
@property (nonatomic, weak, readonly) UIView *view;
@property(nonatomic, assign, readonly) BOOL isUIView;
@end
@@ -154,7 +153,6 @@ static YGConfigRef globalConfig;
YGNodeSetContext(_node, (__bridge void *) view);
_isEnabled = NO;
_isIncludedInLayout = YES;
_isUIView = [view isMemberOfClass:[UIView class]];
}
return self;
@@ -180,7 +178,7 @@ static YGConfigRef globalConfig;
// the measure function. Since we already know that this is a leaf,
// this *should* be fine. Forgive me Hack Gods.
const YGNodeRef node = self.node;
if (YGNodeHasMeasureFunc(node)) {
if (YGNodeGetMeasureFunc(node) == NULL) {
YGNodeSetMeasureFunc(node, YGMeasureView);
}
@@ -229,7 +227,6 @@ YG_PROPERTY(YGWrap, flexWrap, FlexWrap)
YG_PROPERTY(YGOverflow, overflow, Overflow)
YG_PROPERTY(YGDisplay, display, Display)
YG_PROPERTY(CGFloat, flex, Flex)
YG_PROPERTY(CGFloat, flexGrow, FlexGrow)
YG_PROPERTY(CGFloat, flexShrink, FlexShrink)
YG_AUTO_VALUE_PROPERTY(flexBasis, FlexBasis)
@@ -334,20 +331,10 @@ static YGSize YGMeasureView(
const CGFloat constrainedHeight = (heightMode == YGMeasureModeUndefined) ? CGFLOAT_MAX: height;
UIView *view = (__bridge UIView*) YGNodeGetContext(node);
CGSize sizeThatFits = CGSizeZero;
// The default implementation of sizeThatFits: returns the existing size of
// the view. That means that if we want to layout an empty UIView, which
// already has got a frame set, its measured size should be CGSizeZero, but
// UIKit returns the existing size.
//
// See https://github.com/facebook/yoga/issues/606 for more information.
if (!view.yoga.isUIView || [view.subviews count] > 0) {
sizeThatFits = [view sizeThatFits:(CGSize){
.width = constrainedWidth,
.height = constrainedHeight,
}];
}
const CGSize sizeThatFits = [view sizeThatFits:(CGSize) {
.width = constrainedWidth,
.height = constrainedHeight,
}];
return (YGSize) {
.width = YGSanitizeMeasurement(constrainedWidth, sizeThatFits.width, widthMode),
@@ -425,7 +412,9 @@ static void YGRemoveAllChildren(const YGNodeRef node)
return;
}
YGNodeRemoveAllChildren(node);
while (YGNodeGetChildCount(node) > 0) {
YGNodeRemoveChild(node, YGNodeGetChild(node, YGNodeGetChildCount(node) - 1));
}
}
static CGFloat YGRoundPixelValue(CGFloat value)

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
@@ -127,15 +127,6 @@
XCTAssertEqual(longTextLabelSize.width + textBadgeView.yoga.intrinsicSize.width, containerSize.width);
}
- (void)testSizeThatFitsEmptyView {
UIView* view = [[UIView alloc] initWithFrame:CGRectMake(10, 10, 200, 200)];
view.yoga.isEnabled = YES;
const CGSize viewSize = view.yoga.intrinsicSize;
XCTAssertEqual(viewSize.height, 0);
XCTAssertEqual(viewSize.width, 0);
}
- (void)testPreservingOrigin
{
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0,0,50,75)];

View File

@@ -1,10 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// !$*UTF8*$!
{
archiveVersion = 1;

View File

@@ -1,10 +1,3 @@
<!--
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
-->
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">

View File

@@ -1,10 +1,3 @@
<!--
Copyright (c) Facebook, Inc. and its affiliates.
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree.
-->
<?xml version="1.0" encoding="UTF-8"?>
<Workspace
version = "1.0">

View File

@@ -1,11 +1,11 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "yoga_android_aar", "yoga_android_resource")
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "PROGRUARD_ANNOTATIONS_TARGET", "android_aar", "android_resource")
yoga_android_aar(
android_aar(
name = "android",
manifest_skeleton = "src/main/AndroidManifest.xml",
visibility = [
@@ -20,7 +20,7 @@ yoga_android_aar(
],
)
yoga_android_resource(
android_resource(
name = "res",
package = "com.facebook.yoga.android",
res = "src/main/res",

View File

@@ -1,10 +1,3 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
apply plugin: 'com.jfrog.bintray'
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'

View File

@@ -1,10 +1,3 @@
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the LICENSE
# file in the root directory of this source tree.
#
GROUP=com.facebook.yoga.android
POM_NAME=YogaLayout
POM_DESCRIPTION=YogaLayout

View File

@@ -4,10 +4,9 @@
# This source code is licensed under the license found in the
# LICENSE-examples file in the root directory of this source tree.
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_RES_TARGET", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "yoga_android_binary", "yoga_android_resource")
load("//:yoga_defs.bzl", "ANDROID_SAMPLE_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_RES_TARGET", "android_binary", "android_resource")
yoga_android_binary(
android_binary(
name = "sample",
keystore = ":debug_keystore",
manifest = "AndroidManifest.xml",
@@ -17,7 +16,7 @@ yoga_android_binary(
],
)
yoga_android_resource(
android_resource(
name = "res",
package = "com.facebook.samples.yoga",
res = "res",
@@ -29,7 +28,7 @@ yoga_android_resource(
],
)
fb_native.keystore(
keystore(
name = "debug_keystore",
properties = "debug.keystore.properties",
store = "debug.keystore",

View File

@@ -1,11 +1,11 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# Copyright (c) 2014-present, Facebook, Inc.
#
# This source code is licensed under the license found in the
# LICENSE-examples file in the root directory of this source tree.
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "SOLOADER_TARGET", "yoga_android_library")
load("//:yoga_defs.bzl", "ANDROID_JAVA_TARGET", "ANDROID_SAMPLE_RES_TARGET", "ANDROID_SUPPORT_TARGET", "APPCOMPAT_TARGET", "SOLOADER_TARGET", "android_library")
yoga_android_library(
android_library(
name = "yoga",
srcs = glob(["**/*.java"]),
visibility = [

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright (c) Facebook, Inc. and its affiliates.
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.

View File

@@ -1,11 +1,11 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
load("//tools/build_defs/oss:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET", "yoga_android_library")
load("//:yoga_defs.bzl", "ANDROID_RES_TARGET", "INFER_ANNOTATIONS_TARGET", "JAVA_TARGET", "JSR_305_TARGET", "SOLOADER_TARGET", "android_library")
yoga_android_library(
android_library(
name = "android",
srcs = glob(["**/*.java"]),
visibility = [

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
@@ -33,7 +33,7 @@ public class VirtualYogaLayout extends ViewGroup {
final private List<View> mChildren = new LinkedList<>();
final private Map<View, YogaNode> mYogaNodes = new HashMap<>();
final private YogaNode mYogaNode = YogaNode.create();
final private YogaNode mYogaNode = new YogaNode();
public VirtualYogaLayout(Context context) {
super(context);
@@ -73,7 +73,7 @@ public class VirtualYogaLayout extends ViewGroup {
return;
}
YogaNode node = YogaNode.create();
YogaNode node = new YogaNode();
YogaLayout.LayoutParams lp = new YogaLayout.LayoutParams(params);
YogaLayout.applyLayoutParams(lp, node, child);
node.setData(child);

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
@@ -46,14 +46,14 @@ import java.util.Map;
* <YogaLayout
* xmlns:android="http://schemas.android.com/apk/res/android"
* xmlns:yoga="http://schemas.android.com/apk/com.facebook.yoga.android"
* android:layout_width="match_owner"
* android:layout_height="match_owner"
* android:layout_width="match_parent"
* android:layout_height="match_parent"
* yoga:flex_direction="row"
* yoga:padding_all="10dp"
* >
* <TextView
* android:layout_width="match_owner"
* android:layout_height="match_owner"
* android:layout_width="match_parent"
* android:layout_height="match_parent"
* android:text="Hello, World!"
* yoga:flex="1"
* />
@@ -78,7 +78,7 @@ public class YogaLayout extends ViewGroup {
public YogaLayout(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
mYogaNode = YogaNode.create();
mYogaNode = new YogaNode();
mYogaNodes = new HashMap<>();
mYogaNode.setData(this);
@@ -155,7 +155,7 @@ public class YogaLayout extends ViewGroup {
if(mYogaNodes.containsKey(child)) {
childNode = mYogaNodes.get(child);
} else {
childNode = YogaNode.create();
childNode = new YogaNode();
}
childNode.setData(child);
@@ -262,11 +262,11 @@ public class YogaLayout extends ViewGroup {
return;
}
final YogaNode owner = node.getOwner();
final YogaNode parent = node.getParent();
for (int i = 0; i < owner.getChildCount(); i++) {
if (owner.getChildAt(i).equals(node)) {
owner.removeChildAt(i);
for (int i = 0; i < parent.getChildCount(); i++) {
if (parent.getChildAt(i).equals(node)) {
parent.removeChildAt(i);
break;
}
}
@@ -315,7 +315,7 @@ public class YogaLayout extends ViewGroup {
@Override
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 owner's onLayout, in which
// Either we are a root of a tree, or this function is called by our parent's onLayout, in which
// case our r-l and b-t are the size of our node.
if (!(getParent() instanceof YogaLayout)) {
createLayout(
@@ -699,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
* the {@code yoga:width} and {@code yoga:height} if we are given them explicitly. If other
* options (such as {@code match_owner} or {@code wrap_content} are given, then the owner
* options (such as {@code match_parent} or {@code wrap_content} are given, then the parent
* LayoutParams will store them, and we deal with them during layout. (see
* {@link YogaLayout#createLayout})
*
@@ -773,9 +773,9 @@ public class YogaLayout extends ViewGroup {
* {@code View}'s measure function.
*
* @param node The yoga node to measure
* @param width The suggested width from the owner
* @param width The suggested width from the parent
* @param widthMode The type of suggestion for the width
* @param height The suggested height from the owner
* @param height The suggested height from the parent
* @param heightMode The type of suggestion for the height
* @return A measurement output ({@code YogaMeasureOutput}) for the node
*/

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8" ?>
<!--
Copyright (c) Facebook, Inc. and its affiliates.
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.

View File

@@ -1,10 +1,11 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
load("//tools/build_defs/oss:yoga_defs.bzl", "subdir_glob", "yoga_cxx_binary", "yoga_dep")
yoga_cxx_binary(
load("//:yoga_defs.bzl", "yoga_dep")
cxx_binary(
name = "benchmark",
srcs = glob(["*.c"]),
headers = subdir_glob([("", "*.h")]),

View File

@@ -1,82 +1,19 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include <math.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include "YGBenchmark.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,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
static YGSize _measure(YGNodeRef node,
float width,
YGMeasureMode widthMode,
float height,
YGMeasureMode heightMode) {
return (YGSize){
.width = widthMode == YGMeasureModeUndefined ? 10 : width,
.height = heightMode == YGMeasureModeUndefined ? 10 : width,
@@ -84,6 +21,7 @@ static YGSize _measure(
}
YGBENCHMARKS({
YGBENCHMARK("Stack with flex", {
const YGNodeRef root = YGNodeNew();
YGNodeStyleSetWidth(root, 100);
@@ -159,10 +97,9 @@ YGBENCHMARKS({
YGNodeStyleSetHeight(grandGrandChild, 10);
YGNodeInsertChild(grandChild, grandGrandChild, 0);
for (uint32_t iiii = 0; iiii < 10; iiii++) {
for (uint32_t iii = 0; iii < 10; iii++) {
const YGNodeRef grandGrandGrandChild = YGNodeNew();
YGNodeStyleSetFlexDirection(
grandGrandGrandChild, YGFlexDirectionRow);
YGNodeStyleSetFlexDirection(grandGrandGrandChild, YGFlexDirectionRow);
YGNodeStyleSetFlexGrow(grandGrandGrandChild, 1);
YGNodeStyleSetWidth(grandGrandGrandChild, 10);
YGNodeStyleSetHeight(grandGrandGrandChild, 10);
@@ -175,4 +112,5 @@ YGBENCHMARKS({
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
YGNodeFreeRecursive(root);
});
});

71
benchmark/YGBenchmark.h Normal file
View File

@@ -0,0 +1,71 @@
/**
* 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.
*/
#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);
}

View File

@@ -1,20 +1,12 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven { url 'https://maven.google.com/' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
classpath 'com.android.tools.build:gradle:3.0.0'
classpath 'com.jfrog.bintray.gradle:gradle-bintray-plugin:1.7.3'
classpath 'com.github.dcendents:android-maven-gradle-plugin:2.0'
@@ -25,7 +17,6 @@ buildscript {
allprojects {
repositories {
google()
jcenter()
}
}

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,36 +1,29 @@
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.
load("//tools/build_defs:fb_native_wrapper.bzl", "fb_native")
load(
"//tools/build_defs/oss:yoga_defs.bzl",
"BASE_COMPILER_FLAGS",
"yoga_apple_binary",
"yoga_cxx_library",
"yoga_dep",
)
load("//:yoga_defs.bzl", "BASE_COMPILER_FLAGS", "yoga_dep", "cxx_library", "is_apple_platform")
COMPILER_FLAGS = BASE_COMPILER_FLAGS + ["-std=c++11"]
fb_native.csharp_library(
csharp_library(
name = "yogalibnet46",
srcs = glob(["**/*.cs"]),
dll_name = "Facebook.Yoga.dll",
framework_ver = "net46",
)
fb_native.csharp_library(
csharp_library(
name = "yogalibnet45",
srcs = glob(["**/*.cs"]),
dll_name = "Facebook.Yoga.dll",
framework_ver = "net45",
)
yoga_cxx_library(
cxx_library(
name = "yoganet",
srcs = ["Yoga/YGInterop.cpp"],
srcs = glob(["Yoga/YGInterop.cpp"]),
compiler_flags = COMPILER_FLAGS,
link_style = "static",
link_whole = True,
@@ -39,4 +32,40 @@ yoga_cxx_library(
deps = [yoga_dep(":yoga")],
)
yoga_apple_binary()
if is_apple_platform():
yoganet_ios_srcs = []
for arch in [
'iphonesimulator-x86_64', 'iphoneos-arm64'
]:
name = 'yoganet-' + arch
yoganet_ios_srcs.append(':' + name)
genrule(
name = name,
srcs = [
yoga_dep(':yoga#%s,static' % arch),
yoga_dep('YogaKit:YogaKit#%s,static' % arch),
yoga_dep('csharp:yoganet#%s,static' % arch),
],
out = 'libyoga-%s.a' % arch,
cmd = 'libtool -static -o $OUT $SRCS',
visibility = [yoga_dep('csharp:yoganet-ios')],
)
genrule(
name = 'yoganet-ios',
srcs = yoganet_ios_srcs,
out = 'libyoga.a',
cmd = 'lipo $SRCS -create -output $OUT',
visibility = ['PUBLIC'],
)
yoganet_macosx_target = 'csharp:yoganet#macosx-%s,dynamic'
genrule(
name = 'yoganet-macosx',
srcs = [
yoga_dep(yoganet_macosx_target % 'x86_64')
],
out = 'libyoga.dylib',
cmd = 'lipo $SRCS -create -output $OUT',
visibility = ['PUBLIC'],
)

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
@@ -10,6 +10,12 @@ using System.Runtime.InteropServices;
namespace Facebook.Yoga
{
#if WINDOWS_UWP_ARM
using YogaValueType = IntPtr;
#else
using YogaValueType = YogaValue;
#endif
internal static class Native
{
#if (UNITY_IOS && !UNITY_EDITOR) || __IOS__
@@ -68,14 +74,6 @@ namespace Facebook.Yoga
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern bool YGConfigGetUseWebDefaults(YGConfigHandle config);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGConfigSetUseLegacyStretchBehaviour(
YGConfigHandle config,
bool useLegacyStretchBehavior);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern bool YGConfigGetUseLegacyStretchBehaviour(YGConfigHandle config);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGConfigSetPointScaleFactor(
YGConfigHandle config,
@@ -90,14 +88,6 @@ namespace Facebook.Yoga
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeRemoveChild(YGNodeHandle node, YGNodeHandle child);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeSetIsReferenceBaseline(
YGNodeHandle node,
bool isReferenceBaseline);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern bool YGNodeIsReferenceBaseline(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeCalculateLayout(
YGNodeHandle node,
@@ -228,7 +218,7 @@ namespace Facebook.Yoga
public static extern void YGNodeStyleSetFlexBasisAuto(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetFlexBasis(YGNodeHandle node);
public static extern YogaValueType YGNodeStyleGetFlexBasis(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetWidth(YGNodeHandle node, float width);
@@ -240,7 +230,7 @@ namespace Facebook.Yoga
public static extern void YGNodeStyleSetWidthAuto(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetWidth(YGNodeHandle node);
public static extern YogaValueType YGNodeStyleGetWidth(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetHeight(YGNodeHandle node, float height);
@@ -252,7 +242,7 @@ namespace Facebook.Yoga
public static extern void YGNodeStyleSetHeightAuto(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetHeight(YGNodeHandle node);
public static extern YogaValueType YGNodeStyleGetHeight(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetMinWidth(YGNodeHandle node, float minWidth);
@@ -261,7 +251,7 @@ namespace Facebook.Yoga
public static extern void YGNodeStyleSetMinWidthPercent(YGNodeHandle node, float minWidth);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetMinWidth(YGNodeHandle node);
public static extern YogaValueType YGNodeStyleGetMinWidth(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetMinHeight(YGNodeHandle node, float minHeight);
@@ -270,7 +260,7 @@ namespace Facebook.Yoga
public static extern void YGNodeStyleSetMinHeightPercent(YGNodeHandle node, float minHeight);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetMinHeight(YGNodeHandle node);
public static extern YogaValueType YGNodeStyleGetMinHeight(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetMaxWidth(YGNodeHandle node, float maxWidth);
@@ -279,7 +269,7 @@ namespace Facebook.Yoga
public static extern void YGNodeStyleSetMaxWidthPercent(YGNodeHandle node, float maxWidth);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetMaxWidth(YGNodeHandle node);
public static extern YogaValueType YGNodeStyleGetMaxWidth(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetMaxHeight(YGNodeHandle node, float maxHeight);
@@ -288,7 +278,7 @@ namespace Facebook.Yoga
public static extern void YGNodeStyleSetMaxHeightPercent(YGNodeHandle node, float maxHeight);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetMaxHeight(YGNodeHandle node);
public static extern YogaValueType YGNodeStyleGetMaxHeight(YGNodeHandle node);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetAspectRatio(YGNodeHandle node, float aspectRatio);
@@ -307,7 +297,7 @@ namespace Facebook.Yoga
public static extern void YGNodeStyleSetPositionPercent(YGNodeHandle node, YogaEdge edge, float position);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetPosition(YGNodeHandle node, YogaEdge edge);
public static extern YogaValueType YGNodeStyleGetPosition(YGNodeHandle node, YogaEdge edge);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetMargin(YGNodeHandle node, YogaEdge edge, float margin);
@@ -319,7 +309,7 @@ namespace Facebook.Yoga
public static extern void YGNodeStyleSetMarginAuto(YGNodeHandle node, YogaEdge edge);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetMargin(YGNodeHandle node, YogaEdge edge);
public static extern YogaValueType YGNodeStyleGetMargin(YGNodeHandle node, YogaEdge edge);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetPadding(YGNodeHandle node, YogaEdge edge, float padding);
@@ -328,7 +318,7 @@ namespace Facebook.Yoga
public static extern void YGNodeStyleSetPaddingPercent(YGNodeHandle node, YogaEdge edge, float padding);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern YogaValue YGNodeStyleGetPadding(YGNodeHandle node, YogaEdge edge);
public static extern YogaValueType YGNodeStyleGetPadding(YGNodeHandle node, YogaEdge edge);
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
public static extern void YGNodeStyleSetBorder(YGNodeHandle node, YogaEdge edge, float border);

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
/**
* 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.
@@ -117,19 +117,6 @@ namespace Facebook.Yoga
}
}
public bool UseLegacyStretchBehaviour
{
get
{
return Native.YGConfigGetUseLegacyStretchBehaviour(_ygConfig);
}
set
{
Native.YGConfigSetUseLegacyStretchBehaviour(_ygConfig, value);
}
}
public float PointScaleFactor
{
set

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
/**
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
/**
* 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.
@@ -13,7 +13,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Left);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Left));
}
set
@@ -26,7 +26,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Top);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Top));
}
set
@@ -39,7 +39,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Right);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Right));
}
set
@@ -52,7 +52,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Bottom);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Bottom));
}
set
@@ -65,7 +65,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Start);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.Start));
}
set
@@ -78,7 +78,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.End);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPosition(_ygNode, YogaEdge.End));
}
set
@@ -103,7 +103,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Left);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Left));
}
set
@@ -116,7 +116,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Top);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Top));
}
set
@@ -129,7 +129,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Right);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Right));
}
set
@@ -142,7 +142,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Bottom);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Bottom));
}
set
@@ -155,7 +155,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Start);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Start));
}
set
@@ -168,7 +168,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.End);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.End));
}
set
@@ -181,7 +181,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Horizontal);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Horizontal));
}
set
@@ -194,7 +194,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Vertical);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.Vertical));
}
set
@@ -207,7 +207,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.All);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMargin(_ygNode, YogaEdge.All));
}
set
@@ -236,7 +236,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Left);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Left));
}
set
@@ -249,7 +249,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Top);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Top));
}
set
@@ -262,7 +262,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Right);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Right));
}
set
@@ -275,7 +275,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Bottom);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Bottom));
}
set
@@ -288,7 +288,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Start);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Start));
}
set
@@ -301,7 +301,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.End);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.End));
}
set
@@ -314,7 +314,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Horizontal);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Horizontal));
}
set
@@ -327,7 +327,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Vertical);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.Vertical));
}
set
@@ -340,7 +340,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.All);
return YogaValue.MarshalValue(Native.YGNodeStyleGetPadding(_ygNode, YogaEdge.All));
}
set

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
/**
* 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.
@@ -271,7 +271,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetFlexBasis(_ygNode);
return YogaValue.MarshalValue(Native.YGNodeStyleGetFlexBasis(_ygNode));
}
set
@@ -295,7 +295,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetWidth(_ygNode);
return YogaValue.MarshalValue(Native.YGNodeStyleGetWidth(_ygNode));
}
set
@@ -319,7 +319,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetHeight(_ygNode);
return YogaValue.MarshalValue(Native.YGNodeStyleGetHeight(_ygNode));
}
set
@@ -343,7 +343,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMaxWidth(_ygNode);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMaxWidth(_ygNode));
}
set
@@ -363,7 +363,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMaxHeight(_ygNode);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMaxHeight(_ygNode));
}
set
@@ -383,7 +383,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMinWidth(_ygNode);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMinWidth(_ygNode));
}
set
@@ -403,7 +403,7 @@ namespace Facebook.Yoga
{
get
{
return Native.YGNodeStyleGetMinHeight(_ygNode);
return YogaValue.MarshalValue(Native.YGNodeStyleGetMinHeight(_ygNode));
}
set
@@ -519,19 +519,6 @@ namespace Facebook.Yoga
Native.YGNodeSetHasNewLayout(_ygNode, false);
}
public bool IsReferenceBaseline
{
get
{
return Native.YGNodeIsReferenceBaseline(_ygNode);
}
set
{
Native.YGNodeSetIsReferenceBaseline(_ygNode, value);
}
}
public bool ValuesEqual(float f1, float f2)
{
if (float.IsNaN(f1) || float.IsNaN(f2))
@@ -607,7 +594,7 @@ namespace Facebook.Yoga
}
public void CalculateLayout(
float width = YogaConstants.Undefined,
float width = YogaConstants.Undefined,
float height = YogaConstants.Undefined)
{
Native.YGNodeCalculateLayout(

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
@@ -91,5 +91,17 @@ namespace Facebook.Yoga
{
return Point(pointValue);
}
#if WINDOWS_UWP_ARM
internal static YogaValue MarshalValue(IntPtr ptr)
{
return Marshal.PtrToStructure<YogaValue>(ptr);
}
#else
internal static YogaValue MarshalValue(YogaValue value)
{
return value;
}
#endif
}
}

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,10 +1,2 @@
#!/bin/sh
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
./csharp/Mac/Facebook.Yoga.Mac.Tests/bin/Release/Facebook.Yoga.Mac.Tests.app/Contents/MacOS/Facebook.Yoga.Mac.Tests
./csharp/Mac/Facebook.Yoga.Mac.Tests/bin/Release/Facebook.Yoga.Mac.Tests.app/Contents/MacOS/Facebook.Yoga.Mac.Tests

View File

@@ -1,5 +1,5 @@
#!/bin/sh
# Copyright (c) Facebook, Inc. and its affiliates.
# 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
using Facebook.Yoga;
@@ -206,8 +206,8 @@ namespace Facebook.Yoga.Universal.Tests
return MeasureOutput.Make(123.4f, 81.7f);
});
node.CalculateLayout();
Assert.AreEqual(124, node.LayoutWidth);
Assert.AreEqual(82, node.LayoutHeight);
Assert.AreEqual(123, node.LayoutWidth);
Assert.AreEqual(81, node.LayoutHeight);
}
[TestMethod]
@@ -268,12 +268,7 @@ namespace Facebook.Yoga.Universal.Tests
parent.Insert(0, child0);
parent.Insert(0, child1);
parent.CalculateLayout();
Assert.AreEqual(parent.Print(),
"<div layout=\"width: 100; height: 120; top: 0; left: 0;\" style=\"width: 100px; height: 120px; \" >\n" +
" <div layout=\"width: 35; height: 45; top: 0; left: 0;\" style=\"width: 35px; height: 45px; \" ></div>\n" +
" <div layout=\"width: 30; height: 40; top: 45; left: 0;\" style=\"width: 30px; height: 40px; \" ></div>\n" +
"</div>"
);
Assert.AreEqual(parent.Print(), "{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 100, height: 120, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 35, height: 45, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 30, height: 40, },\n]},\n");
}
[TestMethod]
@@ -419,4 +414,4 @@ namespace Facebook.Yoga.Universal.Tests
}
#endif
}
}
}

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,9 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#include "YGInterop.h"
static YGInteropLogger gManagedLogger;

View File

@@ -1,9 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
#include <yoga/Yoga.h>

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup Label="ProjectConfigurations">
<ProjectConfiguration Include="Debug|ARM">
@@ -33,47 +33,47 @@
<RootNamespace>Yoga</RootNamespace>
<AppContainerApplication>true</AppContainerApplication>
<ApplicationType>Windows Store</ApplicationType>
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.14393.0</WindowsTargetPlatformMinVersion>
<WindowsTargetPlatformVersion>10.0.10586.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.10240.0</WindowsTargetPlatformMinVersion>
<ApplicationTypeRevision>10.0</ApplicationTypeRevision>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@@ -116,7 +116,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<LinkIncremental>true</LinkIncremental>
<OutDir>bin\Universal\$(PlatformTarget)\$(Configuration)\</OutDir>
<IntDir>obj\Universal\$(PlatformTarget)\$(Configuration)\</IntDir>
<IntDir>obj\$(PlatformTarget)\$(Configuration)\</IntDir>
<TargetName>yoga</TargetName>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
@@ -242,31 +242,19 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\yoga\Utils.h" />
<ClInclude Include="..\..\yoga\YGConfig.h" />
<ClInclude Include="..\..\yoga\YGEnums.h" />
<ClInclude Include="..\..\yoga\YGFloatOptional.h" />
<ClInclude Include="..\..\yoga\YGLayout.h" />
<ClInclude Include="..\..\yoga\YGMacros.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="..\..\yoga\YGMacros.h" />
<ClInclude Include="..\..\yoga\YGNodeList.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="YGInterop.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\yoga\Utils.cpp" />
<ClCompile Include="..\..\yoga\YGConfig.cpp" />
<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="..\..\yoga\YGEnums.c" />
<ClCompile Include="..\..\yoga\Yoga.c" />
<ClCompile Include="..\..\yoga\YGNodeList.c" />
<ClCompile Include="YGInterop.cpp" />
<ClCompile Include="dllmain.cpp">
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>
@@ -296,4 +284,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

View File

@@ -21,40 +21,22 @@
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
<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">
<ClInclude Include="..\..\yoga\Yoga.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\yoga\YGMacros.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\yoga\YGNode.h">
<ClInclude Include="..\..\yoga\YGNodeList.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\yoga\YGNodePrint.h">
<ClInclude Include="YGInterop.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\yoga\YGStyle.h">
<ClInclude Include="resource.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">
<ClInclude Include="..\..\yoga\YGEnums.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
@@ -65,34 +47,16 @@
<ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter>
</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">
<Filter>Source Files</Filter>
</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">
<ClCompile Include="..\..\yoga\YGEnums.c">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
@@ -101,4 +65,4 @@
<Filter>Resource Files</Filter>
</ResourceCompile>
</ItemGroup>
</Project>
</Project>

View File

@@ -38,39 +38,39 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>true</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<UseDebugLibraries>false</UseDebugLibraries>
<PlatformToolset>v141</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<WholeProgramOptimization>true</WholeProgramOptimization>
<CharacterSet>Unicode</CharacterSet>
</PropertyGroup>
@@ -227,31 +227,19 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\..\yoga\Utils.h" />
<ClInclude Include="..\..\yoga\YGConfig.h" />
<ClInclude Include="..\..\yoga\YGEnums.h" />
<ClInclude Include="..\..\yoga\YGFloatOptional.h" />
<ClInclude Include="..\..\yoga\YGLayout.h" />
<ClInclude Include="..\..\yoga\YGMacros.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="..\..\yoga\YGEnums.h" />
<ClInclude Include="..\..\yoga\YGMacros.h" />
<ClInclude Include="..\..\yoga\YGNodeList.h" />
<ClInclude Include="resource.h" />
<ClInclude Include="YGInterop.h" />
<ClInclude Include="stdafx.h" />
<ClInclude Include="targetver.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\..\yoga\Utils.cpp" />
<ClCompile Include="..\..\yoga\YGConfig.cpp" />
<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="..\..\yoga\Yoga.c" />
<ClCompile Include="..\..\yoga\YGEnums.c" />
<ClCompile Include="..\..\yoga\YGNodeList.c" />
<ClCompile Include="YGInterop.cpp" />
<ClCompile Include="dllmain.cpp">
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</CompileAsManaged>

View File

@@ -21,40 +21,19 @@
<ClInclude Include="targetver.h">
<Filter>Header Files</Filter>
</ClInclude>
<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">
<ClInclude Include="..\..\yoga\Yoga.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\yoga\YGMacros.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\yoga\YGNode.h">
<ClInclude Include="..\..\yoga\YGNodeList.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\yoga\YGNodePrint.h">
<ClInclude Include="YGInterop.h">
<Filter>Header Files</Filter>
</ClInclude>
<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">
<ClInclude Include="resource.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
@@ -65,36 +44,15 @@
<ClCompile Include="dllmain.cpp">
<Filter>Source Files</Filter>
</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">
<Filter>Source Files</Filter>
</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>
<ResourceCompile Include="Yoga.rc">

View File

@@ -1,9 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// dllmain.cpp : Defines the entry point for the DLL application.
#include "stdafx.h"

View File

@@ -1,9 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// stdafx.cpp : source file that includes just the standard includes
// Yoga.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information

View File

@@ -1,9 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently

View File

@@ -1,9 +1,10 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
#pragma once
// Including SDKDDKVer.h defines the highest available Windows platform.

View File

@@ -1,12 +1,4 @@
#!/bin/sh
#
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
#
cd `dirname "$0"`
echo $ANDROID_SDK
BUCK_RELEASE=2018.02.16.01
@@ -30,3 +22,4 @@ $BUCK build \
//csharp:yoganet-macosx \
//csharp:yoganet#android-armv7,shared \
//csharp:yoganet#android-x86,shared

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,104 +0,0 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
using System;
using NUnit.Framework;
namespace Facebook.Yoga
{
[TestFixture]
public class YGAlignBaselineTest
{
[Test]
public void Test_align_baseline_parent_using_child_in_column_as_reference()
{
YogaConfig config = new YogaConfig();
YogaNode root = createYGNode(config, YogaFlexDirection.Row, 1000, 1000, true);
YogaNode root_child0 = createYGNode(config, YogaFlexDirection.Column, 500, 600, false);
root.Insert(0, root_child0);
YogaNode root_child1 = createYGNode(config, YogaFlexDirection.Column, 500, 800, false);
root.Insert(1, root_child1);
YogaNode root_child1_child0 = createYGNode(config, YogaFlexDirection.Column, 500, 300, false);
root_child1.Insert(0, root_child1_child0);
YogaNode root_child1_child1 = createYGNode(config, YogaFlexDirection.Column, 500, 400, false);
root_child1_child1.SetBaselineFunction((_, width, height) => {
return height / 2;
});
root_child1_child1.IsReferenceBaseline = true;
root_child1.Insert(1, root_child1_child1);
root.CalculateLayout();
Assert.AreEqual(0f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(500f, root_child1.LayoutX);
Assert.AreEqual(100f, root_child1.LayoutY);
Assert.AreEqual(0f, root_child1_child0.LayoutX);
Assert.AreEqual(0f, root_child1_child0.LayoutY);
Assert.AreEqual(0f, root_child1_child1.LayoutX);
Assert.AreEqual(300f, root_child1_child1.LayoutY);
}
[Test]
public void Test_align_baseline_parent_using_child_in_row_as_reference()
{
YogaConfig config = new YogaConfig();
YogaNode root = createYGNode(config, YogaFlexDirection.Row, 1000, 1000, true);
YogaNode root_child0 = createYGNode(config, YogaFlexDirection.Column, 500, 600, false);
root.Insert(0, root_child0);
YogaNode root_child1 = createYGNode(config, YogaFlexDirection.Row, 500, 800, true);
root.Insert(1, root_child1);
YogaNode root_child1_child0 = createYGNode(config, YogaFlexDirection.Row, 500, 500, false);
root_child1.Insert(0, root_child1_child0);
YogaNode root_child1_child1 = createYGNode(config, YogaFlexDirection.Row, 500, 400, false);
root_child1_child1.SetBaselineFunction((_, width, height) => {
return height / 2;
});
root_child1_child1.IsReferenceBaseline = true;
root_child1.Insert(1, root_child1_child1);
root.StyleDirection = YogaDirection.LTR;
root.CalculateLayout();
Assert.AreEqual(0f, root_child0.LayoutX);
Assert.AreEqual(0f, root_child0.LayoutY);
Assert.AreEqual(500f, root_child1.LayoutX);
Assert.AreEqual(100f, root_child1.LayoutY);
Assert.AreEqual(0f, root_child1_child0.LayoutX);
Assert.AreEqual(0f, root_child1_child0.LayoutY);
Assert.AreEqual(500f, root_child1_child1.LayoutX);
Assert.AreEqual(300f, root_child1_child1.LayoutY);
}
private YogaNode createYGNode(YogaConfig config, YogaFlexDirection flexDirection, int width, int height, bool alignBaseline) {
YogaNode node = new YogaNode(config);
node.FlexDirection = flexDirection;
node.Width = width;
node.Height = height;
if (alignBaseline) {
node.AlignItems = YogaAlign.Baseline;
}
return node;
}
}
}

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

View File

@@ -1,5 +1,5 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
* 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.

Some files were not shown because too many files have changed in this diff Show More