Merge branch 'master' into xamarin_mac_support
48
.gitignore
vendored
@@ -5,6 +5,54 @@
|
|||||||
/.buckconfig.local
|
/.buckconfig.local
|
||||||
/.buckd
|
/.buckd
|
||||||
/gentest/test.html
|
/gentest/test.html
|
||||||
|
.buckversion
|
||||||
|
|
||||||
# Visual studio code
|
# Visual studio code
|
||||||
.vscode
|
.vscode
|
||||||
|
*.pdb
|
||||||
|
*.tlog
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.log
|
||||||
|
*.orig
|
||||||
|
|
||||||
|
# Xcode
|
||||||
|
## Build generated
|
||||||
|
build/
|
||||||
|
DerivedData/
|
||||||
|
|
||||||
|
## Various settings
|
||||||
|
*.pbxuser
|
||||||
|
!default.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
!default.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
!default.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
!default.perspectivev3
|
||||||
|
xcuserdata/
|
||||||
|
|
||||||
|
## Other
|
||||||
|
*.moved-aside
|
||||||
|
*.xcuserstate
|
||||||
|
|
||||||
|
## Obj-C/Swift specific
|
||||||
|
*.hmap
|
||||||
|
*.ipa
|
||||||
|
*.dSYM.zip
|
||||||
|
*.dSYM
|
||||||
|
|
||||||
|
# CocoaPods
|
||||||
|
#
|
||||||
|
# We recommend against adding the Pods directory to your .gitignore. However
|
||||||
|
# you should judge for yourself, the pros and cons are mentioned at:
|
||||||
|
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
||||||
|
#
|
||||||
|
Pods/
|
||||||
|
|
||||||
|
# Carthage
|
||||||
|
#
|
||||||
|
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||||
|
# Carthage/Checkouts
|
||||||
|
|
||||||
|
Carthage/Build
|
||||||
|
48
.hgignore
@@ -5,6 +5,54 @@
|
|||||||
/.buckconfig.local
|
/.buckconfig.local
|
||||||
/.buckd
|
/.buckd
|
||||||
/gentest/test.html
|
/gentest/test.html
|
||||||
|
.buckversion
|
||||||
|
|
||||||
# Visual studio code
|
# Visual studio code
|
||||||
.vscode
|
.vscode
|
||||||
|
*.pdb
|
||||||
|
*.tlog
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.log
|
||||||
|
*.orig
|
||||||
|
|
||||||
|
# Xcode
|
||||||
|
## Build generated
|
||||||
|
build/
|
||||||
|
DerivedData/
|
||||||
|
|
||||||
|
## Various settings
|
||||||
|
*.pbxuser
|
||||||
|
!default.pbxuser
|
||||||
|
*.mode1v3
|
||||||
|
!default.mode1v3
|
||||||
|
*.mode2v3
|
||||||
|
!default.mode2v3
|
||||||
|
*.perspectivev3
|
||||||
|
!default.perspectivev3
|
||||||
|
xcuserdata/
|
||||||
|
|
||||||
|
## Other
|
||||||
|
*.moved-aside
|
||||||
|
*.xcuserstate
|
||||||
|
|
||||||
|
## Obj-C/Swift specific
|
||||||
|
*.hmap
|
||||||
|
*.ipa
|
||||||
|
*.dSYM.zip
|
||||||
|
*.dSYM
|
||||||
|
|
||||||
|
# CocoaPods
|
||||||
|
#
|
||||||
|
# We recommend against adding the Pods directory to your .gitignore. However
|
||||||
|
# you should judge for yourself, the pros and cons are mentioned at:
|
||||||
|
# https://guides.cocoapods.org/using/using-cocoapods.html#should-i-check-the-pods-directory-into-source-control
|
||||||
|
#
|
||||||
|
Pods/
|
||||||
|
|
||||||
|
# Carthage
|
||||||
|
#
|
||||||
|
# Add this line if you want to avoid checking in source code from Carthage dependencies.
|
||||||
|
# Carthage/Checkouts
|
||||||
|
|
||||||
|
Carthage/Build
|
||||||
|
12
.travis.yml
@@ -17,14 +17,26 @@ before_install:
|
|||||||
- brew cask install java
|
- brew cask install java
|
||||||
- brew outdated xctool || brew upgrade xctool
|
- brew outdated xctool || brew upgrade xctool
|
||||||
- brew install mono
|
- brew install mono
|
||||||
|
|
||||||
- export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
|
- export JAVA_HOME=$(/usr/libexec/java_home -v 1.8)
|
||||||
- export PATH=$JAVA_HOME/bin:$PATH
|
- export PATH=$JAVA_HOME/bin:$PATH
|
||||||
|
|
||||||
|
install:
|
||||||
|
- cd javascript
|
||||||
|
- npm install
|
||||||
|
- cd $TRAVIS_BUILD_DIR
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- buck test //:yoga
|
- buck test //:yoga
|
||||||
- buck test //java:java
|
- buck test //java:java
|
||||||
- buck test //YogaKit:YogaKitTests --config cxx.default_platform=iphonesimulator-x86_64 --config cxx.cflags=-DTRAVIS_CI
|
- buck test //YogaKit:YogaKitTests --config cxx.default_platform=iphonesimulator-x86_64 --config cxx.cflags=-DTRAVIS_CI
|
||||||
- sh csharp/tests/Facebook.Yoga/test_macos.sh
|
- sh csharp/tests/Facebook.Yoga/test_macos.sh
|
||||||
|
|
||||||
|
- cd javascript
|
||||||
|
- npm run test:all
|
||||||
|
- npm run bench
|
||||||
|
- cd $TRAVIS_BUILD_DIR
|
||||||
|
|
||||||
- buck run //benchmark:benchmark
|
- buck run //benchmark:benchmark
|
||||||
- git checkout HEAD^
|
- git checkout HEAD^
|
||||||
- buck run //benchmark:benchmark
|
- buck run //benchmark:benchmark
|
||||||
|
@@ -4,6 +4,8 @@
|
|||||||
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.
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
For testing we rely on [gtest](https://github.com/google/googletest) as a submodule. After cloning Yoga run `git submodule init` followed by `git submodule update`.
|
||||||
|
|
||||||
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`.
|
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 generated 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.
|
||||||
|
@@ -96,6 +96,29 @@
|
|||||||
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(514,21), containerSize), @"Size is actually %@", NSStringFromCGSize(containerSize));
|
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(514,21), containerSize), @"Size is actually %@", NSStringFromCGSize(containerSize));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)testThatMarkingLeafsAsDirtyWillTriggerASizeRecalculation
|
||||||
|
{
|
||||||
|
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 500, 50)];
|
||||||
|
[container yg_setUsesYoga:YES];
|
||||||
|
[container yg_setFlexDirection:YGFlexDirectionRow];
|
||||||
|
[container yg_setAlignItems:YGAlignFlexStart];
|
||||||
|
|
||||||
|
UILabel *label = [[UILabel alloc] initWithFrame:CGRectZero];
|
||||||
|
label.text = @"This is a short text.";
|
||||||
|
label.numberOfLines = 1;
|
||||||
|
[label yg_setUsesYoga:YES];
|
||||||
|
[container addSubview:label];
|
||||||
|
|
||||||
|
[container yg_applyLayout];
|
||||||
|
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(146,21), label.bounds.size), @"Size is actually %@", NSStringFromCGSize(label.bounds.size));
|
||||||
|
|
||||||
|
label.text = @"This is a slightly longer text.";
|
||||||
|
[label yg_markDirty];
|
||||||
|
|
||||||
|
[container yg_applyLayout];
|
||||||
|
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(213,21), label.bounds.size), @"Size is actually %@", NSStringFromCGSize(label.bounds.size));
|
||||||
|
}
|
||||||
|
|
||||||
- (void)testFrameAndOriginPlacement
|
- (void)testFrameAndOriginPlacement
|
||||||
{
|
{
|
||||||
const CGSize containerSize = CGSizeMake(320, 50);
|
const CGSize containerSize = CGSizeMake(320, 50);
|
||||||
@@ -268,4 +291,97 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)testyg_isLeafFlag
|
||||||
|
{
|
||||||
|
UIView *view = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
XCTAssertTrue(view.yg_isLeaf);
|
||||||
|
|
||||||
|
for (int i=0; i<10; i++) {
|
||||||
|
UIView *subview = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
[view addSubview:subview];
|
||||||
|
}
|
||||||
|
XCTAssertTrue(view.yg_isLeaf);
|
||||||
|
|
||||||
|
[view yg_setUsesYoga:YES];
|
||||||
|
[view yg_setWidth:50.0];
|
||||||
|
XCTAssertTrue(view.yg_isLeaf);
|
||||||
|
|
||||||
|
UIView *const subview = view.subviews[0];
|
||||||
|
[subview yg_setUsesYoga:YES];
|
||||||
|
[subview yg_setWidth:50.0];
|
||||||
|
XCTAssertFalse(view.yg_isLeaf);
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testThatWeCorrectlyAttachNestedViews
|
||||||
|
{
|
||||||
|
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 50)];
|
||||||
|
[container yg_setUsesYoga:YES];
|
||||||
|
[container yg_setFlexDirection:YGFlexDirectionColumn];
|
||||||
|
|
||||||
|
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
[subview1 yg_setUsesYoga:YES];
|
||||||
|
[subview1 yg_setWidth:100];
|
||||||
|
[subview1 yg_setFlexGrow:1];
|
||||||
|
[subview1 yg_setFlexDirection:YGFlexDirectionColumn];
|
||||||
|
[container addSubview:subview1];
|
||||||
|
|
||||||
|
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
[subview2 yg_setUsesYoga:YES];
|
||||||
|
[subview2 yg_setWidth:150];
|
||||||
|
[subview2 yg_setFlexGrow:1];
|
||||||
|
[subview2 yg_setFlexDirection:YGFlexDirectionColumn];
|
||||||
|
[container addSubview:subview2];
|
||||||
|
|
||||||
|
for (UIView *view in @[subview1, subview2]) {
|
||||||
|
UIView *someView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
[someView yg_setUsesYoga:YES];
|
||||||
|
[someView yg_setFlexGrow:1];
|
||||||
|
[view addSubview:someView];
|
||||||
|
}
|
||||||
|
[container yg_applyLayout];
|
||||||
|
|
||||||
|
// Add the same amount of new views, reapply layout.
|
||||||
|
for (UIView *view in @[subview1, subview2]) {
|
||||||
|
UIView *someView = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
[someView yg_setUsesYoga:YES];
|
||||||
|
[someView yg_setFlexGrow:1];
|
||||||
|
[view addSubview:someView];
|
||||||
|
}
|
||||||
|
[container yg_applyLayout];
|
||||||
|
|
||||||
|
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(100, 25), subview1.bounds.size), @"Actual size is %@", NSStringFromCGSize(subview1.bounds.size));
|
||||||
|
for (UIView *subview in subview1.subviews) {
|
||||||
|
const CGSize subviewSize = subview.bounds.size;
|
||||||
|
XCTAssertFalse(CGSizeEqualToSize(CGSizeZero, subviewSize));
|
||||||
|
XCTAssertFalse(isnan(subviewSize.height));
|
||||||
|
XCTAssertFalse(isnan(subviewSize.width));
|
||||||
|
}
|
||||||
|
|
||||||
|
XCTAssertTrue(CGSizeEqualToSize(CGSizeMake(150, 25), subview2.bounds.size), @"Actual size is %@", NSStringFromCGSize(subview2.bounds.size));
|
||||||
|
for (UIView *subview in subview2.subviews) {
|
||||||
|
const CGSize subviewSize = subview.bounds.size;
|
||||||
|
XCTAssertFalse(CGSizeEqualToSize(CGSizeZero, subview.bounds.size));
|
||||||
|
XCTAssertFalse(isnan(subviewSize.height));
|
||||||
|
XCTAssertFalse(isnan(subviewSize.width));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
- (void)testThatANonLeafNodeCanBecomeALeafNode
|
||||||
|
{
|
||||||
|
UIView *container = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 300, 50)];
|
||||||
|
[container yg_setUsesYoga:YES];
|
||||||
|
|
||||||
|
UIView *subview1 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
[subview1 yg_setUsesYoga:YES];
|
||||||
|
[container addSubview:subview1];
|
||||||
|
|
||||||
|
UIView *subview2 = [[UIView alloc] initWithFrame:CGRectZero];
|
||||||
|
[subview2 yg_setUsesYoga:YES];
|
||||||
|
[subview1 addSubview:subview2];
|
||||||
|
|
||||||
|
[container yg_applyLayout];
|
||||||
|
[subview2 removeFromSuperview];
|
||||||
|
[container yg_applyLayout];
|
||||||
|
}
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
- (void)yg_setAlignSelf:(YGAlign)alignSelf;
|
- (void)yg_setAlignSelf:(YGAlign)alignSelf;
|
||||||
- (void)yg_setPositionType:(YGPositionType)positionType;
|
- (void)yg_setPositionType:(YGPositionType)positionType;
|
||||||
- (void)yg_setFlexWrap:(YGWrap)flexWrap;
|
- (void)yg_setFlexWrap:(YGWrap)flexWrap;
|
||||||
|
- (void)yg_setOverflow:(YGOverflow)overflow;
|
||||||
|
|
||||||
- (void)yg_setFlexGrow:(CGFloat)flexGrow;
|
- (void)yg_setFlexGrow:(CGFloat)flexGrow;
|
||||||
- (void)yg_setFlexShrink:(CGFloat)flexShrink;
|
- (void)yg_setFlexShrink:(CGFloat)flexShrink;
|
||||||
@@ -69,4 +70,14 @@
|
|||||||
*/
|
*/
|
||||||
- (NSUInteger)yg_numberOfChildren;
|
- (NSUInteger)yg_numberOfChildren;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Return a BOOL indiciating whether or not we this node contains any subviews that are included in Yoga's layout.
|
||||||
|
*/
|
||||||
|
- (BOOL)yg_isLeaf;
|
||||||
|
|
||||||
|
/**
|
||||||
|
Mark that a view's layout needs to be recalculated. Only works for leaf views.
|
||||||
|
*/
|
||||||
|
- (void)yg_markDirty;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
@@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
#import <objc/runtime.h>
|
#import <objc/runtime.h>
|
||||||
|
|
||||||
|
static const void *kYGNodeBridgeAssociatedKey = &kYGNodeBridgeAssociatedKey;
|
||||||
|
|
||||||
@interface YGNodeBridge : NSObject
|
@interface YGNodeBridge : NSObject
|
||||||
@property (nonatomic, assign, readonly) YGNodeRef cnode;
|
@property (nonatomic, assign, readonly) YGNodeRef cnode;
|
||||||
@end
|
@end
|
||||||
@@ -39,6 +41,14 @@
|
|||||||
|
|
||||||
@implementation UIView (Yoga)
|
@implementation UIView (Yoga)
|
||||||
|
|
||||||
|
- (void)yg_markDirty
|
||||||
|
{
|
||||||
|
YGNodeBridge *const bridge = objc_getAssociatedObject(self, kYGNodeBridgeAssociatedKey);
|
||||||
|
if (bridge != nil && [self yg_isLeaf]) {
|
||||||
|
YGNodeMarkDirty(bridge.cnode);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (BOOL)yg_usesYoga
|
- (BOOL)yg_usesYoga
|
||||||
{
|
{
|
||||||
NSNumber *usesYoga = objc_getAssociatedObject(self, @selector(yg_usesYoga));
|
NSNumber *usesYoga = objc_getAssociatedObject(self, @selector(yg_usesYoga));
|
||||||
@@ -56,6 +66,20 @@
|
|||||||
return YGNodeGetChildCount([self ygNode]);
|
return YGNodeGetChildCount([self ygNode]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (BOOL)yg_isLeaf
|
||||||
|
{
|
||||||
|
NSAssert([NSThread isMainThread], @"This method must be called on the main thread.");
|
||||||
|
if ([self yg_usesYoga]) {
|
||||||
|
for (UIView *subview in self.subviews) {
|
||||||
|
if ([subview yg_usesYoga] && [subview yg_includeInLayout]) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - Setters
|
#pragma mark - Setters
|
||||||
|
|
||||||
- (void)yg_setIncludeInLayout:(BOOL)includeInLayout
|
- (void)yg_setIncludeInLayout:(BOOL)includeInLayout
|
||||||
@@ -116,6 +140,11 @@
|
|||||||
YGNodeStyleSetFlexWrap([self ygNode], flexWrap);
|
YGNodeStyleSetFlexWrap([self ygNode], flexWrap);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)yg_setOverflow:(YGOverflow)overflow
|
||||||
|
{
|
||||||
|
YGNodeStyleSetOverflow([self ygNode], overflow);
|
||||||
|
}
|
||||||
|
|
||||||
- (void)yg_setFlexGrow:(CGFloat)flexGrow
|
- (void)yg_setFlexGrow:(CGFloat)flexGrow
|
||||||
{
|
{
|
||||||
YGNodeStyleSetFlexGrow([self ygNode], flexGrow);
|
YGNodeStyleSetFlexGrow([self ygNode], flexGrow);
|
||||||
@@ -207,13 +236,12 @@
|
|||||||
|
|
||||||
- (YGNodeRef)ygNode
|
- (YGNodeRef)ygNode
|
||||||
{
|
{
|
||||||
YGNodeBridge *node = objc_getAssociatedObject(self, @selector(ygNode));
|
YGNodeBridge *node = objc_getAssociatedObject(self, kYGNodeBridgeAssociatedKey);
|
||||||
if (!node) {
|
if (!node) {
|
||||||
node = [YGNodeBridge new];
|
node = [YGNodeBridge new];
|
||||||
YGNodeSetContext(node.cnode, (__bridge void *) self);
|
YGNodeSetContext(node.cnode, (__bridge void *) self);
|
||||||
objc_setAssociatedObject(self, @selector(ygNode), node, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
objc_setAssociatedObject(self, kYGNodeBridgeAssociatedKey, node, OBJC_ASSOCIATION_RETAIN_NONATOMIC);
|
||||||
}
|
}
|
||||||
|
|
||||||
return node.cnode;
|
return node.cnode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -276,17 +304,32 @@ static CGFloat YGSanitizeMeasurement(
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void YGAttachNodesFromViewHierachy(UIView *view) {
|
static BOOL YGNodeHasExactSameChildren(const YGNodeRef node, NSArray<UIView *> *subviews)
|
||||||
YGNodeRef node = [view ygNode];
|
{
|
||||||
|
if (YGNodeGetChildCount(node) != subviews.count) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
|
||||||
|
for (int i=0; i<subviews.count; i++) {
|
||||||
|
if (YGNodeGetChild(node, i) != subviews[i].ygNode) {
|
||||||
|
return NO;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return YES;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void YGAttachNodesFromViewHierachy(UIView *const view)
|
||||||
|
{
|
||||||
|
const YGNodeRef node = [view ygNode];
|
||||||
|
|
||||||
// Only leaf nodes should have a measure function
|
// Only leaf nodes should have a measure function
|
||||||
if (![view yg_usesYoga] || view.subviews.count == 0) {
|
if (view.yg_isLeaf) {
|
||||||
YGNodeSetMeasureFunc(node, YGMeasureView);
|
|
||||||
YGRemoveAllChildren(node);
|
YGRemoveAllChildren(node);
|
||||||
|
YGNodeSetMeasureFunc(node, YGMeasureView);
|
||||||
} else {
|
} else {
|
||||||
YGNodeSetMeasureFunc(node, NULL);
|
YGNodeSetMeasureFunc(node, NULL);
|
||||||
|
|
||||||
// Create a list of all the subviews that we are going to use for layout.
|
|
||||||
NSMutableArray<UIView *> *subviewsToInclude = [[NSMutableArray alloc] initWithCapacity:view.subviews.count];
|
NSMutableArray<UIView *> *subviewsToInclude = [[NSMutableArray alloc] initWithCapacity:view.subviews.count];
|
||||||
for (UIView *subview in view.subviews) {
|
for (UIView *subview in view.subviews) {
|
||||||
if ([subview yg_includeInLayout]) {
|
if ([subview yg_includeInLayout]) {
|
||||||
@@ -294,26 +337,15 @@ static void YGAttachNodesFromViewHierachy(UIView *view) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL shouldReconstructChildList = NO;
|
if (!YGNodeHasExactSameChildren(node, subviewsToInclude)) {
|
||||||
if (YGNodeGetChildCount(node) != subviewsToInclude.count) {
|
YGRemoveAllChildren(node);
|
||||||
shouldReconstructChildList = YES;
|
for (int i=0; i<subviewsToInclude.count; i++) {
|
||||||
} else {
|
YGNodeInsertChild(node, [subviewsToInclude[i] ygNode], i);
|
||||||
for (int i = 0; i < subviewsToInclude.count; i++) {
|
|
||||||
if (YGNodeGetChild(node, i) != [subviewsToInclude[i] ygNode]) {
|
|
||||||
shouldReconstructChildList = YES;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (shouldReconstructChildList) {
|
for (UIView *const subview in subviewsToInclude) {
|
||||||
YGRemoveAllChildren(node);
|
|
||||||
|
|
||||||
for (int i = 0 ; i < subviewsToInclude.count; i++) {
|
|
||||||
UIView *const subview = subviewsToInclude[i];
|
|
||||||
YGNodeInsertChild(node, [subview ygNode], i);
|
|
||||||
YGAttachNodesFromViewHierachy(subview);
|
YGAttachNodesFromViewHierachy(subview);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -340,7 +372,8 @@ static CGFloat YGRoundPixelValue(CGFloat value)
|
|||||||
return round(value * scale) / scale;
|
return round(value * scale) / scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void YGApplyLayoutToViewHierarchy(UIView *view) {
|
static void YGApplyLayoutToViewHierarchy(UIView *view)
|
||||||
|
{
|
||||||
NSCAssert([NSThread isMainThread], @"Framesetting should only be done on the main thread.");
|
NSCAssert([NSThread isMainThread], @"Framesetting should only be done on the main thread.");
|
||||||
if (![view yg_includeInLayout]) {
|
if (![view yg_includeInLayout]) {
|
||||||
return;
|
return;
|
||||||
@@ -368,9 +401,8 @@ static void YGApplyLayoutToViewHierarchy(UIView *view) {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
const BOOL isLeaf = ![view yg_usesYoga] || view.subviews.count == 0;
|
if (!view.yg_isLeaf) {
|
||||||
if (!isLeaf) {
|
for (NSUInteger i=0; i<view.subviews.count; i++) {
|
||||||
for (NSUInteger i = 0; i < view.subviews.count; i++) {
|
|
||||||
YGApplyLayoutToViewHierarchy(view.subviews[i]);
|
YGApplyLayoutToViewHierarchy(view.subviews[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,91 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<Scheme
|
|
||||||
LastUpgradeVersion = "0810"
|
|
||||||
version = "1.3">
|
|
||||||
<BuildAction
|
|
||||||
parallelizeBuildables = "YES"
|
|
||||||
buildImplicitDependencies = "YES">
|
|
||||||
<BuildActionEntries>
|
|
||||||
<BuildActionEntry
|
|
||||||
buildForTesting = "YES"
|
|
||||||
buildForRunning = "YES"
|
|
||||||
buildForProfiling = "YES"
|
|
||||||
buildForArchiving = "YES"
|
|
||||||
buildForAnalyzing = "YES">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "13687D421DF8748300E7C260"
|
|
||||||
BuildableName = "YogaKitSample.app"
|
|
||||||
BlueprintName = "YogaKitSample"
|
|
||||||
ReferencedContainer = "container:YogaKitSample.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildActionEntry>
|
|
||||||
</BuildActionEntries>
|
|
||||||
</BuildAction>
|
|
||||||
<TestAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
|
||||||
<Testables>
|
|
||||||
</Testables>
|
|
||||||
<MacroExpansion>
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "13687D421DF8748300E7C260"
|
|
||||||
BuildableName = "YogaKitSample.app"
|
|
||||||
BlueprintName = "YogaKitSample"
|
|
||||||
ReferencedContainer = "container:YogaKitSample.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</MacroExpansion>
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</TestAction>
|
|
||||||
<LaunchAction
|
|
||||||
buildConfiguration = "Debug"
|
|
||||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
|
||||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
|
||||||
launchStyle = "0"
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
ignoresPersistentStateOnLaunch = "NO"
|
|
||||||
debugDocumentVersioning = "YES"
|
|
||||||
debugServiceExtension = "internal"
|
|
||||||
allowLocationSimulation = "YES">
|
|
||||||
<BuildableProductRunnable
|
|
||||||
runnableDebuggingMode = "0">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "13687D421DF8748300E7C260"
|
|
||||||
BuildableName = "YogaKitSample.app"
|
|
||||||
BlueprintName = "YogaKitSample"
|
|
||||||
ReferencedContainer = "container:YogaKitSample.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildableProductRunnable>
|
|
||||||
<AdditionalOptions>
|
|
||||||
</AdditionalOptions>
|
|
||||||
</LaunchAction>
|
|
||||||
<ProfileAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
|
||||||
savedToolIdentifier = ""
|
|
||||||
useCustomWorkingDirectory = "NO"
|
|
||||||
debugDocumentVersioning = "YES">
|
|
||||||
<BuildableProductRunnable
|
|
||||||
runnableDebuggingMode = "0">
|
|
||||||
<BuildableReference
|
|
||||||
BuildableIdentifier = "primary"
|
|
||||||
BlueprintIdentifier = "13687D421DF8748300E7C260"
|
|
||||||
BuildableName = "YogaKitSample.app"
|
|
||||||
BlueprintName = "YogaKitSample"
|
|
||||||
ReferencedContainer = "container:YogaKitSample.xcodeproj">
|
|
||||||
</BuildableReference>
|
|
||||||
</BuildableProductRunnable>
|
|
||||||
</ProfileAction>
|
|
||||||
<AnalyzeAction
|
|
||||||
buildConfiguration = "Debug">
|
|
||||||
</AnalyzeAction>
|
|
||||||
<ArchiveAction
|
|
||||||
buildConfiguration = "Release"
|
|
||||||
revealArchiveInOrganizer = "YES">
|
|
||||||
</ArchiveAction>
|
|
||||||
</Scheme>
|
|
@@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
|
||||||
<plist version="1.0">
|
|
||||||
<dict>
|
|
||||||
<key>SchemeUserState</key>
|
|
||||||
<dict>
|
|
||||||
<key>YogaKitSample.xcscheme</key>
|
|
||||||
<dict>
|
|
||||||
<key>orderHint</key>
|
|
||||||
<integer>0</integer>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
<key>SuppressBuildableAutocreation</key>
|
|
||||||
<dict>
|
|
||||||
<key>13687D421DF8748300E7C260</key>
|
|
||||||
<dict>
|
|
||||||
<key>primary</key>
|
|
||||||
<true/>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</dict>
|
|
||||||
</plist>
|
|
9
csharp/.gitignore
vendored
@@ -30,15 +30,14 @@ bld/
|
|||||||
# MSTest test Results
|
# MSTest test Results
|
||||||
[Tt]est[Rr]esult*/
|
[Tt]est[Rr]esult*/
|
||||||
[Bb]uild[Ll]og.*
|
[Bb]uild[Ll]og.*
|
||||||
csharp/tests/Facebook.Yoga/NUnit-[0-9\.]+/
|
|
||||||
csharp/tests/Facebook.Yoga/YogaTest.dll
|
|
||||||
csharp/tests/Facebook.Yoga/YogaTest.dll.mdb
|
|
||||||
csharp/tests/Facebook.Yoga/libyoga.dylib
|
|
||||||
csharp/tests/Facebook.Yoga/libyoga.dylib.dSYM/
|
|
||||||
|
|
||||||
# NUNIT
|
# NUNIT
|
||||||
*.VisualState.xml
|
*.VisualState.xml
|
||||||
TestResult.xml
|
TestResult.xml
|
||||||
|
tests/Facebook.Yoga/NUnit-[0-9\.]*/
|
||||||
|
tests/Facebook.Yoga/YogaTest.dll
|
||||||
|
tests/Facebook.Yoga/YogaTest.dll.mdb
|
||||||
|
tests/Facebook.Yoga/libyoga.dylib
|
||||||
|
|
||||||
# Build Results of an ATL Project
|
# Build Results of an ATL Project
|
||||||
[Dd]ebugPS/
|
[Dd]ebugPS/
|
||||||
|
@@ -34,11 +34,10 @@ bld/
|
|||||||
# NUNIT
|
# NUNIT
|
||||||
*.VisualState.xml
|
*.VisualState.xml
|
||||||
TestResult.xml
|
TestResult.xml
|
||||||
csharp/tests/Facebook.Yoga/NUnit-[0-9\.]+/
|
tests/Facebook.Yoga/NUnit-[0-9\.]*/
|
||||||
csharp/tests/Facebook.Yoga/YogaTest.dll
|
tests/Facebook.Yoga/YogaTest.dll
|
||||||
csharp/tests/Facebook.Yoga/YogaTest.dll.mdb
|
tests/Facebook.Yoga/YogaTest.dll.mdb
|
||||||
csharp/tests/Facebook.Yoga/libyoga.dylib
|
tests/Facebook.Yoga/libyoga.dylib
|
||||||
csharp/tests/Facebook.Yoga/libyoga.dylib.dSYM/
|
|
||||||
|
|
||||||
# Build Results of an ATL Project
|
# Build Results of an ATL Project
|
||||||
[Dd]ebugPS/
|
[Dd]ebugPS/
|
||||||
|
@@ -1,46 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio 14
|
|
||||||
VisualStudioVersion = 14.0.25420.1
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Yoga", "Yoga\Yoga.vcxproj", "{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}"
|
|
||||||
EndProject
|
|
||||||
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Facebook.Yoga", "Facebook.Yoga\Facebook.Yoga.xproj", "{75BB7605-E54B-4EDE-8F5A-FF1F24464236}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|Any CPU = Debug|Any CPU
|
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Debug|x86 = Debug|x86
|
|
||||||
Release|Any CPU = Release|Any CPU
|
|
||||||
Release|x64 = Release|x64
|
|
||||||
Release|x86 = Release|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
|
||||||
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|Any CPU.ActiveCfg = Release|Win32
|
|
||||||
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x64.Build.0 = Release|x64
|
|
||||||
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x86.Build.0 = Release|Win32
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{75BB7605-E54B-4EDE-8F5A-FF1F24464236}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
31
csharp/Facebook.Yoga/Border.cs
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Facebook.Yoga
|
||||||
|
{
|
||||||
|
public class Border
|
||||||
|
{
|
||||||
|
public float? Top;
|
||||||
|
public float? Bottom;
|
||||||
|
public float? Left;
|
||||||
|
public float? Right;
|
||||||
|
|
||||||
|
public Border(
|
||||||
|
float? top = null,
|
||||||
|
float? bottom = null,
|
||||||
|
float? left = null,
|
||||||
|
float? right = null)
|
||||||
|
{
|
||||||
|
Top = top;
|
||||||
|
Bottom = bottom;
|
||||||
|
Left = left;
|
||||||
|
Right = right;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
40
csharp/Facebook.Yoga/Facebook.Yoga.Shared.projitems
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||||
|
<HasSharedItems>true</HasSharedItems>
|
||||||
|
<SharedGUID>91c42d32-291d-4b72-90b4-551663d60b8b</SharedGUID>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Configuration">
|
||||||
|
<Import_RootNamespace>Facebook.Yoga.Shared</Import_RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Border.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)MeasureFunction.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)MeasureOutput.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Native.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Spacing.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaAlign.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaConstants.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaDimension.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaDirection.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaEdge.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaExperimentalFeature.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaFlexDirection.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaJustify.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaLogger.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaLogLevel.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaMeasureFunc.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaMeasureMode.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaNode.Create.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaNode.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaOverflow.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaPositionType.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaPrintOptions.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaSize.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaUnit.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaValue.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaValueExtensions.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaWrap.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
13
csharp/Facebook.Yoga/Facebook.Yoga.Shared.shproj
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>91c42d32-291d-4b72-90b4-551663d60b8b</ProjectGuid>
|
||||||
|
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
|
||||||
|
<PropertyGroup />
|
||||||
|
<Import Project="Facebook.Yoga.Shared.projitems" Label="Shared" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||||
|
</Project>
|
@@ -1,21 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup>
|
|
||||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
|
|
||||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<ProjectGuid>75bb7605-e54b-4ede-8f5a-ff1f24464236</ProjectGuid>
|
|
||||||
<RootNamespace>Facebook.Yoga</RootNamespace>
|
|
||||||
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
|
|
||||||
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
|
|
||||||
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
<SchemaVersion>2.0</SchemaVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.targets" Condition="'$(VSToolsPath)' != ''" />
|
|
||||||
</Project>
|
|
@@ -9,7 +9,7 @@
|
|||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
{
|
{
|
||||||
public delegate long MeasureFunction(
|
public delegate YogaSize MeasureFunction(
|
||||||
YogaNode node,
|
YogaNode node,
|
||||||
float width,
|
float width,
|
||||||
YogaMeasureMode widthMode,
|
YogaMeasureMode widthMode,
|
||||||
|
@@ -11,24 +11,9 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
public class MeasureOutput
|
public class MeasureOutput
|
||||||
{
|
{
|
||||||
public static long Make(double width, double height)
|
public static YogaSize Make(float width, float height)
|
||||||
{
|
{
|
||||||
return Make((int) width, (int) height);
|
return new YogaSize { width = width, height = height};
|
||||||
}
|
|
||||||
|
|
||||||
public static long Make(int width, int height)
|
|
||||||
{
|
|
||||||
return (long)(((ulong) width) << 32 | ((uint) height));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int GetWidth(long measureOutput)
|
|
||||||
{
|
|
||||||
return (int) (0xFFFFFFFF & (measureOutput >> 32));
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int GetHeight(long measureOutput)
|
|
||||||
{
|
|
||||||
return (int) (0xFFFFFFFF & measureOutput);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
/**
|
/**
|
||||||
* Copyright (c) 2014-present, Facebook, Inc.
|
* Copyright (c) 2014-present, Facebook, Inc.
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
*
|
*
|
||||||
@@ -20,263 +20,306 @@ namespace Facebook.Yoga
|
|||||||
private const string DllName = "yoga";
|
private const string DllName = "yoga";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[DllImport(DllName)]
|
internal class YGNodeHandle : SafeHandle
|
||||||
|
{
|
||||||
|
private YGNodeHandle() : base(IntPtr.Zero, true)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool IsInvalid
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return this.handle == IntPtr.Zero;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override bool ReleaseHandle()
|
||||||
|
{
|
||||||
|
Native.YGNodeFree(this.handle);
|
||||||
|
GC.KeepAlive(this);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGInteropSetLogger(
|
public static extern void YGInteropSetLogger(
|
||||||
[MarshalAs(UnmanagedType.FunctionPtr)] YogaLogger.Func func);
|
[MarshalAs(UnmanagedType.FunctionPtr)] YogaLogger.Func func);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr YGNodeNew();
|
public static extern YGNodeHandle YGNodeNew();
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeFree(IntPtr node);
|
public static extern void YGNodeFree(IntPtr node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeReset(IntPtr node);
|
public static extern void YGNodeReset(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern int YGNodeGetInstanceCount();
|
public static extern int YGNodeGetInstanceCount();
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGSetExperimentalFeatureEnabled(
|
public static extern void YGSetExperimentalFeatureEnabled(
|
||||||
YogaExperimentalFeature feature,
|
YogaExperimentalFeature feature,
|
||||||
bool enabled);
|
bool enabled);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern bool YGIsExperimentalFeatureEnabled(
|
public static extern bool YGIsExperimentalFeatureEnabled(
|
||||||
YogaExperimentalFeature feature);
|
YogaExperimentalFeature feature);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeInsertChild(IntPtr node, IntPtr child, uint index);
|
public static extern void YGNodeInsertChild(YGNodeHandle node, YGNodeHandle child, uint index);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeRemoveChild(IntPtr node, IntPtr child);
|
public static extern void YGNodeRemoveChild(YGNodeHandle node, YGNodeHandle child);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern IntPtr YGNodeGetChild(IntPtr node, uint index);
|
public static extern void YGNodeCalculateLayout(YGNodeHandle node,
|
||||||
|
|
||||||
[DllImport(DllName)]
|
|
||||||
public static extern uint YGNodeGetChildCount(IntPtr node);
|
|
||||||
|
|
||||||
[DllImport(DllName)]
|
|
||||||
public static extern void YGNodeCalculateLayout(IntPtr node,
|
|
||||||
float availableWidth,
|
float availableWidth,
|
||||||
float availableHeight,
|
float availableHeight,
|
||||||
YogaDirection parentDirection);
|
YogaDirection parentDirection);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeMarkDirty(IntPtr node);
|
public static extern void YGNodeMarkDirty(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
[return: MarshalAs(UnmanagedType.I1)]
|
[return: MarshalAs(UnmanagedType.I1)]
|
||||||
public static extern bool YGNodeIsDirty(IntPtr node);
|
public static extern bool YGNodeIsDirty(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodePrint(IntPtr node, YogaPrintOptions options);
|
public static extern void YGNodePrint(YGNodeHandle node, YogaPrintOptions options);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
[return: MarshalAs(UnmanagedType.I1)]
|
[return: MarshalAs(UnmanagedType.I1)]
|
||||||
public static extern bool YGValueIsUndefined(float value);
|
public static extern bool YGValueIsUndefined(float value);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeCopyStyle(IntPtr dstNode, IntPtr srcNode);
|
public static extern void YGNodeCopyStyle(YGNodeHandle dstNode, YGNodeHandle srcNode);
|
||||||
|
|
||||||
#region YG_NODE_PROPERTY
|
#region YG_NODE_PROPERTY
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeSetContext(IntPtr node, IntPtr context);
|
|
||||||
|
|
||||||
[DllImport(DllName)]
|
|
||||||
public static extern IntPtr YGNodeGetContext(IntPtr node);
|
|
||||||
|
|
||||||
[DllImport(DllName)]
|
|
||||||
public static extern void YGNodeSetMeasureFunc(
|
public static extern void YGNodeSetMeasureFunc(
|
||||||
IntPtr node,
|
YGNodeHandle node,
|
||||||
[MarshalAs(UnmanagedType.FunctionPtr)] YogaMeasureFunc measureFunc);
|
[MarshalAs(UnmanagedType.FunctionPtr)] YogaMeasureFunc measureFunc);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
[return: MarshalAs(UnmanagedType.FunctionPtr)]
|
[return: MarshalAs(UnmanagedType.FunctionPtr)]
|
||||||
public static extern YogaMeasureFunc YGNodeGetMeasureFunc(IntPtr node);
|
public static extern YogaMeasureFunc YGNodeGetMeasureFunc(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeSetHasNewLayout(IntPtr node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout);
|
public static extern void YGNodeSetHasNewLayout(YGNodeHandle node, [MarshalAs(UnmanagedType.I1)] bool hasNewLayout);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
[return: MarshalAs(UnmanagedType.I1)]
|
[return: MarshalAs(UnmanagedType.I1)]
|
||||||
public static extern bool YGNodeGetHasNewLayout(IntPtr node);
|
public static extern bool YGNodeGetHasNewLayout(YGNodeHandle node);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region YG_NODE_STYLE_PROPERTY
|
#region YG_NODE_STYLE_PROPERTY
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetDirection(IntPtr node, YogaDirection direction);
|
public static extern void YGNodeStyleSetDirection(YGNodeHandle node, YogaDirection direction);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaDirection YGNodeStyleGetDirection(IntPtr node);
|
public static extern YogaDirection YGNodeStyleGetDirection(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetFlexDirection(IntPtr node, YogaFlexDirection flexDirection);
|
public static extern void YGNodeStyleSetFlexDirection(YGNodeHandle node, YogaFlexDirection flexDirection);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaFlexDirection YGNodeStyleGetFlexDirection(IntPtr node);
|
public static extern YogaFlexDirection YGNodeStyleGetFlexDirection(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetJustifyContent(IntPtr node, YogaJustify justifyContent);
|
public static extern void YGNodeStyleSetJustifyContent(YGNodeHandle node, YogaJustify justifyContent);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaJustify YGNodeStyleGetJustifyContent(IntPtr node);
|
public static extern YogaJustify YGNodeStyleGetJustifyContent(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetAlignContent(IntPtr node, YogaAlign alignContent);
|
public static extern void YGNodeStyleSetAlignContent(YGNodeHandle node, YogaAlign alignContent);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaAlign YGNodeStyleGetAlignContent(IntPtr node);
|
public static extern YogaAlign YGNodeStyleGetAlignContent(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetAlignItems(IntPtr node, YogaAlign alignItems);
|
public static extern void YGNodeStyleSetAlignItems(YGNodeHandle node, YogaAlign alignItems);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaAlign YGNodeStyleGetAlignItems(IntPtr node);
|
public static extern YogaAlign YGNodeStyleGetAlignItems(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetAlignSelf(IntPtr node, YogaAlign alignSelf);
|
public static extern void YGNodeStyleSetAlignSelf(YGNodeHandle node, YogaAlign alignSelf);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaAlign YGNodeStyleGetAlignSelf(IntPtr node);
|
public static extern YogaAlign YGNodeStyleGetAlignSelf(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetPositionType(IntPtr node, YogaPositionType positionType);
|
public static extern void YGNodeStyleSetPositionType(YGNodeHandle node, YogaPositionType positionType);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaPositionType YGNodeStyleGetPositionType(IntPtr node);
|
public static extern YogaPositionType YGNodeStyleGetPositionType(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetFlexWrap(IntPtr node, YogaWrap flexWrap);
|
public static extern void YGNodeStyleSetFlexWrap(YGNodeHandle node, YogaWrap flexWrap);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaWrap YGNodeStyleGetFlexWrap(IntPtr node);
|
public static extern YogaWrap YGNodeStyleGetFlexWrap(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetOverflow(IntPtr node, YogaOverflow flexWrap);
|
public static extern void YGNodeStyleSetOverflow(YGNodeHandle node, YogaOverflow flexWrap);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaOverflow YGNodeStyleGetOverflow(IntPtr node);
|
public static extern YogaOverflow YGNodeStyleGetOverflow(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetFlex(IntPtr node, float flex);
|
public static extern void YGNodeStyleSetFlex(YGNodeHandle node, float flex);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetFlexGrow(IntPtr node, float flexGrow);
|
public static extern void YGNodeStyleSetFlexGrow(YGNodeHandle node, float flexGrow);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetFlexGrow(IntPtr node);
|
public static extern float YGNodeStyleGetFlexGrow(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetFlexShrink(IntPtr node, float flexShrink);
|
public static extern void YGNodeStyleSetFlexShrink(YGNodeHandle node, float flexShrink);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetFlexShrink(IntPtr node);
|
public static extern float YGNodeStyleGetFlexShrink(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetFlexBasis(IntPtr node, float flexBasis);
|
public static extern void YGNodeStyleSetFlexBasis(YGNodeHandle node, float flexBasis);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetFlexBasis(IntPtr node);
|
public static extern void YGNodeStyleSetFlexBasisPercent(YGNodeHandle node, float flexBasis);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetWidth(IntPtr node, float width);
|
public static extern YogaValue YGNodeStyleGetFlexBasis(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetWidth(IntPtr node);
|
public static extern void YGNodeStyleSetWidth(YGNodeHandle node, float width);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetHeight(IntPtr node, float height);
|
public static extern void YGNodeStyleSetWidthPercent(YGNodeHandle node, float width);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetHeight(IntPtr node);
|
public static extern YogaValue YGNodeStyleGetWidth(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetMinWidth(IntPtr node, float minWidth);
|
public static extern void YGNodeStyleSetHeight(YGNodeHandle node, float height);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetMinWidth(IntPtr node);
|
public static extern void YGNodeStyleSetHeightPercent(YGNodeHandle node, float height);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetMinHeight(IntPtr node, float minHeight);
|
public static extern YogaValue YGNodeStyleGetHeight(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetMinHeight(IntPtr node);
|
public static extern void YGNodeStyleSetMinWidth(YGNodeHandle node, float minWidth);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetMaxWidth(IntPtr node, float maxWidth);
|
public static extern void YGNodeStyleSetMinWidthPercent(YGNodeHandle node, float minWidth);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetMaxWidth(IntPtr node);
|
public static extern YogaValue YGNodeStyleGetMinWidth(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetMaxHeight(IntPtr node, float maxHeight);
|
public static extern void YGNodeStyleSetMinHeight(YGNodeHandle node, float minHeight);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetMaxHeight(IntPtr node);
|
public static extern void YGNodeStyleSetMinHeightPercent(YGNodeHandle node, float minHeight);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetAspectRatio(IntPtr node, float aspectRatio);
|
public static extern YogaValue YGNodeStyleGetMinHeight(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetAspectRatio(IntPtr node);
|
public static extern void YGNodeStyleSetMaxWidth(YGNodeHandle node, float maxWidth);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void YGNodeStyleSetMaxWidthPercent(YGNodeHandle node, float maxWidth);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern YogaValue YGNodeStyleGetMaxWidth(YGNodeHandle node);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void YGNodeStyleSetMaxHeight(YGNodeHandle node, float maxHeight);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void YGNodeStyleSetMaxHeightPercent(YGNodeHandle node, float maxHeight);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern YogaValue YGNodeStyleGetMaxHeight(YGNodeHandle node);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void YGNodeStyleSetAspectRatio(YGNodeHandle node, float aspectRatio);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern float YGNodeStyleGetAspectRatio(YGNodeHandle node);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region YG_NODE_STYLE_EDGE_PROPERTY
|
#region YG_NODE_STYLE_EDGE_PROPERTY
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetPosition(IntPtr node, YogaEdge edge, float position);
|
public static extern void YGNodeStyleSetPosition(YGNodeHandle node, YogaEdge edge, float position);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetPosition(IntPtr node, YogaEdge edge);
|
public static extern void YGNodeStyleSetPositionPercent(YGNodeHandle node, YogaEdge edge, float position);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetMargin(IntPtr node, YogaEdge edge, float margin);
|
public static extern YogaValue YGNodeStyleGetPosition(YGNodeHandle node, YogaEdge edge);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetMargin(IntPtr node, YogaEdge edge);
|
public static extern void YGNodeStyleSetMargin(YGNodeHandle node, YogaEdge edge, float margin);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetPadding(IntPtr node, YogaEdge edge, float padding);
|
public static extern void YGNodeStyleSetMarginPercent(YGNodeHandle node, YogaEdge edge, float margin);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetPadding(IntPtr node, YogaEdge edge);
|
public static extern YogaValue YGNodeStyleGetMargin(YGNodeHandle node, YogaEdge edge);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern void YGNodeStyleSetBorder(IntPtr node, YogaEdge edge, float border);
|
public static extern void YGNodeStyleSetPadding(YGNodeHandle node, YogaEdge edge, float padding);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeStyleGetBorder(IntPtr node, YogaEdge edge);
|
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);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern void YGNodeStyleSetBorder(YGNodeHandle node, YogaEdge edge, float border);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern float YGNodeStyleGetBorder(YGNodeHandle node, YogaEdge edge);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region YG_NODE_LAYOUT_PROPERTY
|
#region YG_NODE_LAYOUT_PROPERTY
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeLayoutGetLeft(IntPtr node);
|
public static extern float YGNodeLayoutGetLeft(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeLayoutGetTop(IntPtr node);
|
public static extern float YGNodeLayoutGetTop(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeLayoutGetRight(IntPtr node);
|
public static extern float YGNodeLayoutGetRight(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeLayoutGetBottom(IntPtr node);
|
public static extern float YGNodeLayoutGetBottom(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeLayoutGetWidth(IntPtr node);
|
public static extern float YGNodeLayoutGetWidth(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern float YGNodeLayoutGetHeight(IntPtr node);
|
public static extern float YGNodeLayoutGetHeight(YGNodeHandle node);
|
||||||
|
|
||||||
[DllImport(DllName)]
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
public static extern YogaDirection YGNodeLayoutGetDirection(IntPtr node);
|
public static extern float YGNodeLayoutGetPadding(YGNodeHandle node, YogaEdge edge);
|
||||||
|
|
||||||
|
[DllImport(DllName, ExactSpelling = true, CallingConvention = CallingConvention.Cdecl)]
|
||||||
|
public static extern YogaDirection YGNodeLayoutGetDirection(YGNodeHandle node);
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
}
|
}
|
||||||
|
@@ -11,16 +11,16 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
public class Spacing
|
public class Spacing
|
||||||
{
|
{
|
||||||
public float? Top;
|
public YogaValue? Top;
|
||||||
public float? Bottom;
|
public YogaValue? Bottom;
|
||||||
public float? Left;
|
public YogaValue? Left;
|
||||||
public float? Right;
|
public YogaValue? Right;
|
||||||
|
|
||||||
public Spacing(
|
public Spacing(
|
||||||
float? top = null,
|
YogaValue? top = null,
|
||||||
float? bottom = null,
|
YogaValue? bottom = null,
|
||||||
float? left = null,
|
YogaValue? left = null,
|
||||||
float? right = null)
|
YogaValue? right = null)
|
||||||
{
|
{
|
||||||
Top = top;
|
Top = top;
|
||||||
Bottom = bottom;
|
Bottom = bottom;
|
||||||
|
@@ -16,5 +16,6 @@ namespace Facebook.Yoga
|
|||||||
Center,
|
Center,
|
||||||
FlexEnd,
|
FlexEnd,
|
||||||
Stretch,
|
Stretch,
|
||||||
|
Baseline,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -17,5 +17,10 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
return float.IsNaN(value);
|
return float.IsNaN(value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool IsUndefined(YogaValue value)
|
||||||
|
{
|
||||||
|
return value.Unit == YogaUnit.Undefined;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,17 +26,17 @@ namespace Facebook.Yoga
|
|||||||
float? flex = null,
|
float? flex = null,
|
||||||
float? flexGrow = null,
|
float? flexGrow = null,
|
||||||
float? flexShrink = null,
|
float? flexShrink = null,
|
||||||
float? flexBasis = null,
|
YogaValue? flexBasis = null,
|
||||||
Spacing position = null,
|
Spacing position = null,
|
||||||
Spacing margin = null,
|
Spacing margin = null,
|
||||||
Spacing padding = null,
|
Spacing padding = null,
|
||||||
Spacing border = null,
|
Border border = null,
|
||||||
float? width = null,
|
YogaValue? width = null,
|
||||||
float? height = null,
|
YogaValue? height = null,
|
||||||
float? maxWidth = null,
|
YogaValue? maxWidth = null,
|
||||||
float? maxHeight = null,
|
YogaValue? maxHeight = null,
|
||||||
float? minWidth = null,
|
YogaValue? minWidth = null,
|
||||||
float? minHeight = null)
|
YogaValue? minHeight = null)
|
||||||
{
|
{
|
||||||
YogaNode node = new YogaNode();
|
YogaNode node = new YogaNode();
|
||||||
|
|
||||||
|
@@ -10,14 +10,13 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.InteropServices;
|
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
namespace Facebook.Yoga
|
namespace Facebook.Yoga
|
||||||
{
|
{
|
||||||
public partial class YogaNode : IEnumerable<YogaNode>
|
public partial class YogaNode : IEnumerable<YogaNode>
|
||||||
{
|
{
|
||||||
private IntPtr _ygNode;
|
private Native.YGNodeHandle _ygNode;
|
||||||
private WeakReference _parent;
|
private WeakReference _parent;
|
||||||
private List<YogaNode> _children;
|
private List<YogaNode> _children;
|
||||||
private MeasureFunction _measureFunction;
|
private MeasureFunction _measureFunction;
|
||||||
@@ -29,17 +28,12 @@ namespace Facebook.Yoga
|
|||||||
YogaLogger.Initialize();
|
YogaLogger.Initialize();
|
||||||
|
|
||||||
_ygNode = Native.YGNodeNew();
|
_ygNode = Native.YGNodeNew();
|
||||||
if (_ygNode == IntPtr.Zero)
|
if (_ygNode.IsInvalid)
|
||||||
{
|
{
|
||||||
throw new InvalidOperationException("Failed to allocate native memory");
|
throw new InvalidOperationException("Failed to allocate native memory");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
~YogaNode()
|
|
||||||
{
|
|
||||||
Native.YGNodeFree(_ygNode);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Reset()
|
public void Reset()
|
||||||
{
|
{
|
||||||
_measureFunction = null;
|
_measureFunction = null;
|
||||||
@@ -233,7 +227,7 @@ namespace Facebook.Yoga
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float FlexBasis
|
public YogaValue FlexBasis
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -242,28 +236,49 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Native.YGNodeStyleSetFlexBasis(_ygNode, value);
|
if (value.Unit == YogaUnit.Percent)
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetFlexBasisPercent(_ygNode, value.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetFlexBasis(_ygNode, value.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetMargin(YogaEdge edge)
|
public YogaValue GetMargin(YogaEdge edge)
|
||||||
{
|
{
|
||||||
return Native.YGNodeStyleGetMargin(_ygNode, edge);
|
return Native.YGNodeStyleGetMargin(_ygNode, edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetMargin(YogaEdge edge, float value)
|
public void SetMargin(YogaEdge edge, YogaValue value)
|
||||||
{
|
{
|
||||||
Native.YGNodeStyleSetMargin(_ygNode, edge, value);
|
if (value.Unit == YogaUnit.Percent)
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetMarginPercent(_ygNode, edge, value.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetMargin(_ygNode, edge, value.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetPadding(YogaEdge edge)
|
public YogaValue GetPadding(YogaEdge edge)
|
||||||
{
|
{
|
||||||
return Native.YGNodeStyleGetPadding(_ygNode, edge);
|
return Native.YGNodeStyleGetPadding(_ygNode, edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPadding(YogaEdge edge, float padding)
|
public void SetPadding(YogaEdge edge, YogaValue value)
|
||||||
{
|
{
|
||||||
Native.YGNodeStyleSetPadding(_ygNode, edge, padding);
|
if (value.Unit == YogaUnit.Percent)
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetPaddingPercent(_ygNode, edge, value.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetPadding(_ygNode, edge, value.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetBorder(YogaEdge edge)
|
public float GetBorder(YogaEdge edge)
|
||||||
@@ -276,17 +291,29 @@ namespace Facebook.Yoga
|
|||||||
Native.YGNodeStyleSetBorder(_ygNode, edge, border);
|
Native.YGNodeStyleSetBorder(_ygNode, edge, border);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float GetPosition(YogaEdge edge)
|
public YogaValue GetPosition(YogaEdge edge)
|
||||||
{
|
{
|
||||||
return Native.YGNodeStyleGetPosition(_ygNode, edge);
|
return Native.YGNodeStyleGetPosition(_ygNode, edge);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetPosition(YogaEdge edge, float position)
|
public void SetPosition(YogaEdge edge, YogaValue value)
|
||||||
{
|
{
|
||||||
Native.YGNodeStyleSetPosition(_ygNode, edge, position);
|
if (value.Unit == YogaUnit.Percent)
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetPositionPercent(_ygNode, edge, value.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetPosition(_ygNode, edge, value.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float Width
|
public float GetLayoutPadding(YogaEdge edge)
|
||||||
|
{
|
||||||
|
return Native.YGNodeLayoutGetPadding(_ygNode, edge);
|
||||||
|
}
|
||||||
|
|
||||||
|
public YogaValue Width
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -295,11 +322,18 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Native.YGNodeStyleSetWidth(_ygNode, value);
|
if (value.Unit == YogaUnit.Percent)
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetWidthPercent(_ygNode, value.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetWidth(_ygNode, value.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float Height
|
public YogaValue Height
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -308,11 +342,18 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Native.YGNodeStyleSetHeight(_ygNode, value);
|
if (value.Unit == YogaUnit.Percent)
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetHeightPercent(_ygNode, value.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetHeight(_ygNode, value.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float MaxWidth
|
public YogaValue MaxWidth
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -321,11 +362,18 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Native.YGNodeStyleSetMaxWidth(_ygNode, value);
|
if (value.Unit == YogaUnit.Percent)
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetMaxWidthPercent(_ygNode, value.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetMaxWidth(_ygNode, value.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float MaxHeight
|
public YogaValue MaxHeight
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -334,11 +382,18 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Native.YGNodeStyleSetMaxHeight(_ygNode, value);
|
if (value.Unit == YogaUnit.Percent)
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetMaxHeightPercent(_ygNode, value.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetMaxHeight(_ygNode, value.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float MinWidth
|
public YogaValue MinWidth
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -347,11 +402,18 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Native.YGNodeStyleSetMinWidth(_ygNode, value);
|
if (value.Unit == YogaUnit.Percent)
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetMinWidthPercent(_ygNode, value.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetMinWidth(_ygNode, value.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public float MinHeight
|
public YogaValue MinHeight
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -360,7 +422,14 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
set
|
set
|
||||||
{
|
{
|
||||||
Native.YGNodeStyleSetMinHeight(_ygNode, value);
|
if (value.Unit == YogaUnit.Percent)
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetMinHeightPercent(_ygNode, value.Value);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Native.YGNodeStyleSetMinHeight(_ygNode, value.Value);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -537,8 +606,7 @@ namespace Facebook.Yoga
|
|||||||
throw new InvalidOperationException("Measure function is not defined.");
|
throw new InvalidOperationException("Measure function is not defined.");
|
||||||
}
|
}
|
||||||
|
|
||||||
long output = _measureFunction(this, width, widthMode, height, heightMode);
|
return _measureFunction(this, width, widthMode, height, heightMode);
|
||||||
return new YogaSize { width = MeasureOutput.GetWidth(output), height = MeasureOutput.GetHeight(output) };
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public string Print(YogaPrintOptions options =
|
public string Print(YogaPrintOptions options =
|
||||||
|
18
csharp/Facebook.Yoga/YogaUnit.cs
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Facebook.Yoga
|
||||||
|
{
|
||||||
|
public enum YogaUnit
|
||||||
|
{
|
||||||
|
Undefined,
|
||||||
|
Pixel,
|
||||||
|
Percent,
|
||||||
|
}
|
||||||
|
}
|
87
csharp/Facebook.Yoga/YogaValue.cs
Normal file
@@ -0,0 +1,87 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
namespace Facebook.Yoga
|
||||||
|
{
|
||||||
|
[StructLayout(LayoutKind.Sequential)]
|
||||||
|
public struct YogaValue
|
||||||
|
{
|
||||||
|
private float value;
|
||||||
|
private YogaUnit unit;
|
||||||
|
|
||||||
|
public YogaUnit Unit
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return unit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public float Value
|
||||||
|
{
|
||||||
|
get
|
||||||
|
{
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static YogaValue Pixel(float value)
|
||||||
|
{
|
||||||
|
return new YogaValue
|
||||||
|
{
|
||||||
|
value = value,
|
||||||
|
unit = YogaConstants.IsUndefined(value) ? YogaUnit.Undefined : YogaUnit.Pixel
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool Equals(YogaValue other)
|
||||||
|
{
|
||||||
|
return Unit == other.Unit && (Value.Equals(other.Value) || Unit == YogaUnit.Undefined);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object obj)
|
||||||
|
{
|
||||||
|
if (ReferenceEquals(null, obj)) return false;
|
||||||
|
return obj is YogaValue && Equals((YogaValue) obj);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
unchecked
|
||||||
|
{
|
||||||
|
return (Value.GetHashCode() * 397) ^ (int) Unit;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static YogaValue Undefined()
|
||||||
|
{
|
||||||
|
return new YogaValue
|
||||||
|
{
|
||||||
|
value = YogaConstants.Undefined,
|
||||||
|
unit = YogaUnit.Undefined
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static YogaValue Percent(float value)
|
||||||
|
{
|
||||||
|
return new YogaValue
|
||||||
|
{
|
||||||
|
value = value,
|
||||||
|
unit = YogaConstants.IsUndefined(value) ? YogaUnit.Undefined : YogaUnit.Percent
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public static implicit operator YogaValue(float pixelValue)
|
||||||
|
{
|
||||||
|
return Pixel(pixelValue);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
34
csharp/Facebook.Yoga/YogaValueExtensions.cs
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
namespace Facebook.Yoga
|
||||||
|
{
|
||||||
|
public static class YogaValueExtensions
|
||||||
|
{
|
||||||
|
public static YogaValue Percent(this float value)
|
||||||
|
{
|
||||||
|
return YogaValue.Percent(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static YogaValue Px(this float value)
|
||||||
|
{
|
||||||
|
return YogaValue.Pixel(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static YogaValue Percent(this int value)
|
||||||
|
{
|
||||||
|
return YogaValue.Percent(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static YogaValue Px(this int value)
|
||||||
|
{
|
||||||
|
return YogaValue.Pixel(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -3,7 +3,8 @@
|
|||||||
"version": "3.0.0-*",
|
"version": "3.0.0-*",
|
||||||
|
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"NETStandard.Library": "1.6.0"
|
"NETStandard.Library": "1.6.0",
|
||||||
|
"System.Runtime.Handles": "4.3.0"
|
||||||
},
|
},
|
||||||
|
|
||||||
"frameworks": {
|
"frameworks": {
|
||||||
|
3
csharp/Unity/.gitignore
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
Yoga
|
||||||
|
yoga.dll
|
||||||
|
yoga.unitypackage
|
64
csharp/Unity/pack.sh
Executable file
@@ -0,0 +1,64 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
# 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.
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
|
cd "$( dirname "$0" )"
|
||||||
|
|
||||||
|
if [ \! -f yoga.dll ]; then
|
||||||
|
echo "Launch win.bat on Windows and copy yoga.dll to here"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
function build {
|
||||||
|
buck build $1
|
||||||
|
echo "$root/`buck targets --show-output $1|tail -1|awk '{print $2}'`"
|
||||||
|
}
|
||||||
|
|
||||||
|
function copy {
|
||||||
|
mkdir -p $3
|
||||||
|
cp $1 $3/$2
|
||||||
|
}
|
||||||
|
|
||||||
|
rm -rf Yoga yoga.unitypackage
|
||||||
|
|
||||||
|
root=`buck root|tail -f`
|
||||||
|
mac=$(build '//csharp:yoganet#default,shared')
|
||||||
|
armv7=$(build '//csharp:yoganet#android-armv7,shared')
|
||||||
|
ios=$(build '//csharp:yoganet-ios')
|
||||||
|
win=yoga.dll
|
||||||
|
|
||||||
|
Unity -quit -batchMode -createProject Yoga
|
||||||
|
|
||||||
|
copy $win ${win##*/} Yoga/Assets/Facebook.Yoga/Plugins/x86_64
|
||||||
|
copy $mac yoga Yoga/Assets/Facebook.Yoga/Plugins/x86_64/yoga.bundle/Contents/MacOS
|
||||||
|
armv7path=Assets/Plugins/Android/libs/armeabi-v7a
|
||||||
|
copy $armv7 ${armv7##*/} Yoga/$armv7path
|
||||||
|
iospath=Assets/Plugins/iOS
|
||||||
|
copy $ios ${ios##*/} Yoga/$iospath
|
||||||
|
libs="$armv7path/${armv7##*/} $iospath/${ios##*/}"
|
||||||
|
|
||||||
|
scripts=Yoga/Assets/Facebook.Yoga/Scripts/Facebook.Yoga
|
||||||
|
mkdir -p $scripts
|
||||||
|
(cd ../Facebook.Yoga; tar cf - *.cs)|tar -C $scripts -xf -
|
||||||
|
|
||||||
|
tests=Yoga/Assets/Facebook.Yoga/Editor/Facebook.Yoga.Tests
|
||||||
|
mkdir -p $tests
|
||||||
|
(cd ../tests/Facebook.Yoga; tar cf - *.cs)|tar -C $tests -xf -
|
||||||
|
|
||||||
|
function onerror {
|
||||||
|
local xml=Yoga/EditorTestResults.xml
|
||||||
|
if [ -f $xml ]; then cat $xml|grep 'success="False"'; fi
|
||||||
|
}
|
||||||
|
trap onerror EXIT
|
||||||
|
Unity -quit -batchMode -projectPath `pwd`/Yoga -runEditorTests
|
||||||
|
|
||||||
|
pkg="`pwd`/yoga.unitypackage"
|
||||||
|
Unity -quit -batchMode -projectPath `pwd`/Yoga -exportPackage Assets/Facebook.Yoga $libs $pkg
|
||||||
|
|
||||||
|
echo "Success: $pkg"
|
2
csharp/Unity/win.bat
Executable file
@@ -0,0 +1,2 @@
|
|||||||
|
"C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe" ..\Yoga\Yoga.vcxproj /p:configuration=Release /property:Platform=x64
|
||||||
|
xcopy "..\Yoga\bin\x64\Release\yoga.dll" %~dp0 /s /d /y
|
131
csharp/Windows/Build/Facebook.Yoga.NativeInterop.targets
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<NativeRootPath>$(SolutionDir)..\Yoga\bin\</NativeRootPath>
|
||||||
|
<NativeX86Path>$(NativeRootPath)x86\</NativeX86Path>
|
||||||
|
<NativeX64Path>$(NativeRootPath)x64\</NativeX64Path>
|
||||||
|
<NativeARMPath>$(NativeRootPath)ARM\</NativeARMPath>
|
||||||
|
<NativeDLLMoniker>Yoga</NativeDLLMoniker>
|
||||||
|
<CurrentPlatform Condition="$(PROCESSOR_ARCHITECTURE) =='AMD64' or $(PROCESSOR_ARCHITECTURE) == 'IA64' or $(PROCESSOR_ARCHITEW6432) == 'AMD64'">AMD64</CurrentPlatform>
|
||||||
|
<CurrentPlatform Condition="$(PROCESSOR_ARCHITECTURE) =='ARM'">ARM</CurrentPlatform>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<Choose>
|
||||||
|
<When Condition="$(Platform) == 'AnyCPU'">
|
||||||
|
<Choose>
|
||||||
|
<When Condition="$(Prefer32Bit) == 'true'">
|
||||||
|
<ItemGroup Condition="$(CurrentPlatform) == 'x86' Or $(CurrentPlatform) == 'AMD64'">
|
||||||
|
<Content Include="$(NativeX86Path)$(Configuration)\$(NativeDLLMoniker).dll">
|
||||||
|
<Link>$(NativeDLLMoniker).dll</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(NativeX86Path)$(Configuration)\$(NativeDLLMoniker).pdb">
|
||||||
|
<Link>$(NativeDLLMoniker).pdb</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition="$(CurrentPlatform) == 'ARM'">
|
||||||
|
<Content Include="$(NativeARMPath)$(Configuration)\$(NativeDLLMoniker).dll">
|
||||||
|
<Link>$(NativeDLLMoniker).dll</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(NativeARMPath)$(Configuration)\$(NativeDLLMoniker).pdb">
|
||||||
|
<Link>$(NativeDLLMoniker).pdb</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
</When>
|
||||||
|
<Otherwise>
|
||||||
|
<ItemGroup Condition="$(CurrentPlatform) == 'x86'">
|
||||||
|
<Content Include="$(NativeX86Path)$(Configuration)\$(NativeDLLMoniker).dll">
|
||||||
|
<Link>$(NativeDLLMoniker).dll</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(NativeX86Path)$(Configuration)\$(NativeDLLMoniker).pdb">
|
||||||
|
<Link>$(NativeDLLMoniker).pdb</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition="$(CurrentPlatform) == 'AMD64'">
|
||||||
|
<Content Include="$(NativeX64Path)$(Configuration)\$(NativeDLLMoniker).dll">
|
||||||
|
<Link>$(NativeDLLMoniker).dll</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(NativeX64Path)$(Configuration)\$(NativeDLLMoniker).pdb">
|
||||||
|
<Link>$(NativeDLLMoniker).pdb</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition="$(CurrentPlatform) == 'ARM'">
|
||||||
|
<Content Include="$(NativeARMPath)$(Configuration)\$(NativeDLLMoniker).dll">
|
||||||
|
<Link>$(NativeDLLMoniker).dll</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(NativeARMPath)$(Configuration)\$(NativeDLLMoniker).pdb">
|
||||||
|
<Link>$(NativeDLLMoniker).pdb</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
</Otherwise>
|
||||||
|
</Choose>
|
||||||
|
</When>
|
||||||
|
<Otherwise>
|
||||||
|
<ItemGroup Condition="$(PlatformTarget) == 'x86'">
|
||||||
|
<Content Include="$(NativeX86Path)$(Configuration)\$(NativeDLLMoniker).dll">
|
||||||
|
<Link>$(NativeDLLMoniker).dll</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(NativeX86Path)$(Configuration)\$(NativeDLLMoniker).pdb">
|
||||||
|
<Link>$(NativeDLLMoniker).pdb</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition="$(PlatformTarget) == 'x64'">
|
||||||
|
<Content Include="$(NativeX64Path)$(Configuration)\$(NativeDLLMoniker).dll">
|
||||||
|
<Link>$(NativeDLLMoniker).dll</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(NativeX64Path)$(Configuration)\$(NativeDLLMoniker).pdb">
|
||||||
|
<Link>$(NativeDLLMoniker).pdb</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition="$(PlatformTarget) == 'ARM'">
|
||||||
|
<!--<Content Include="$(NativeARMPath)$(Configuration)\$(NativeDLLMoniker).dll">
|
||||||
|
<Link>$(NativeDLLMoniker).dll</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(NativeARMPath)$(Configuration)\$(NativeDLLMoniker).pdb">
|
||||||
|
<Link>$(NativeDLLMoniker).pdb</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>-->
|
||||||
|
<Content Include="$(NativeX86Path)$(Configuration)\$(NativeDLLMoniker).dll">
|
||||||
|
<Link>$(NativeDLLMoniker).dll</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(NativeX86Path)$(Configuration)\$(NativeDLLMoniker).pdb">
|
||||||
|
<Link>$(NativeDLLMoniker).pdb</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
</Otherwise>
|
||||||
|
</Choose>
|
||||||
|
</Project>
|
@@ -0,0 +1,104 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Facebook.Yoga</RootNamespace>
|
||||||
|
<AssemblyName>Facebook.Yoga.Desktop.Tests</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<TargetFrameworkProfile />
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
|
<OutputPath>bin\x86\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|AnyCPU'">
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="nunit.framework, Version=2.6.4.14350, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\NUnit.2.6.4\lib\nunit.framework.dll</HintPath>
|
||||||
|
<Private>True</Private>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Facebook.Yoga\Facebook.Yoga.csproj">
|
||||||
|
<Project>{3aace384-fdec-4d91-a3b2-eeb21b46c9ad}</Project>
|
||||||
|
<Name>Facebook.Yoga</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="..\..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems" Label="Shared" />
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
<Import Project="$(SolutionDir)Build\Facebook.Yoga.NativeInterop.targets" Condition="Exists('$(SolutionDir)Build\Facebook.Yoga.NativeInterop.targets')" Label="ImportNativeInteropTargets" />
|
||||||
|
<Target Name="EnsureNativeInteropImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references a native interop target that is missing. The missing build target is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('$(SolutionDir)Build\Facebook.Yoga.NativeInterop.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)Build\Facebook.Yoga.NativeInterop.targets'))" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
@@ -0,0 +1,28 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Resources;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
[assembly: AssemblyTitle("Facebook.Yoga.Desktop.Tests")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("Facebook, Inc.")]
|
||||||
|
[assembly: AssemblyProduct("Facebook.Yoga")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright (c) 2014-present, Facebook, Inc.")]
|
||||||
|
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
[assembly: Guid("ac23f444-5545-4196-8b9f-5c1f6b3e7fb3")]
|
||||||
|
|
||||||
|
[assembly: NeutralResourcesLanguage("en")]
|
||||||
|
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
|
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="NUnit" version="2.6.4" targetFramework="net451" />
|
||||||
|
</packages>
|
102
csharp/Windows/Facebook.Yoga.Desktop.sln
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 14
|
||||||
|
VisualStudioVersion = 14.0.25420.1
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{5289E508-8386-45A1-A12B-258A5899CD45}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Native", "Native", "{51A8E803-C084-431F-9130-F277481C2BB2}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NETStandard", "NETStandard", "{DCF7899B-A487-49C0-BCDE-DC088B6750C2}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yoga", "..\Yoga\Yoga.vcxproj", "{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{39A2FFDA-C093-4FA6-8143-45B5019E7DAC}"
|
||||||
|
EndProject
|
||||||
|
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared", "..\Facebook.Yoga\Facebook.Yoga.Shared.shproj", "{91C42D32-291D-4B72-90B4-551663D60B8B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga", "Facebook.Yoga\Facebook.Yoga.csproj", "{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5} = {0446C86B-F47B-4C46-B673-C7AE0CFF35D5}
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared.Tests", "..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.shproj", "{4EDC82D9-A201-4831-8FE0-98F468F8E4AE}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Desktop.Tests", "Facebook.Yoga.Desktop.Tests\Facebook.Yoga.Desktop.Tests.csproj", "{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||||
|
..\Facebook.Yoga\Facebook.Yoga.Shared.projitems*{3aace384-fdec-4d91-a3b2-eeb21b46c9ad}*SharedItemsImports = 4
|
||||||
|
..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems*{4edc82d9-a201-4831-8fe0-98f468f8e4ae}*SharedItemsImports = 13
|
||||||
|
..\Facebook.Yoga\Facebook.Yoga.Shared.projitems*{91c42d32-291d-4b72-90b4-551663d60b8b}*SharedItemsImports = 13
|
||||||
|
..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems*{ac23f444-5545-4196-8b9f-5c1f6b3e7fb3}*SharedItemsImports = 4
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|ARM = Debug|ARM
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|ARM = Release|ARM
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x64.Build.0 = Release|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x64.Build.0 = Release|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x86.Build.0 = Release|x86
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|ARM.Build.0 = Release|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|x64.Build.0 = Release|x64
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|x86.Build.0 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5} = {51A8E803-C084-431F-9130-F277481C2BB2}
|
||||||
|
{91C42D32-291D-4B72-90B4-551663D60B8B} = {39A2FFDA-C093-4FA6-8143-45B5019E7DAC}
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD} = {DCF7899B-A487-49C0-BCDE-DC088B6750C2}
|
||||||
|
{4EDC82D9-A201-4831-8FE0-98F468F8E4AE} = {39A2FFDA-C093-4FA6-8143-45B5019E7DAC}
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3} = {5289E508-8386-45A1-A12B-258A5899CD45}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 7.5 KiB |
After Width: | Height: | Size: 2.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 3.1 KiB |
@@ -0,0 +1,143 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
|
||||||
|
<ProjectGuid>{0C76D2FE-6767-44FE-B03D-21B2076BAA73}</ProjectGuid>
|
||||||
|
<OutputType>AppContainerExe</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Facebook.Yoga.Universal.Tests</RootNamespace>
|
||||||
|
<AssemblyName>Facebook.Yoga.Universal.Tests</AssemblyName>
|
||||||
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
|
<TargetPlatformIdentifier>UAP</TargetPlatformIdentifier>
|
||||||
|
<TargetPlatformVersion>10.0.10586.0</TargetPlatformVersion>
|
||||||
|
<TargetPlatformMinVersion>10.0.10240.0</TargetPlatformMinVersion>
|
||||||
|
<MinimumVisualStudioVersion>14</MinimumVisualStudioVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<PackageCertificateKeyFile>Facebook.Yoga.Universal.Tests_TemporaryKey.pfx</PackageCertificateKeyFile>
|
||||||
|
<UnitTestPlatformVersion Condition="'$(UnitTestPlatformVersion)' == ''">14.0</UnitTestPlatformVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
|
<OutputPath>bin\x86\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>ARM</PlatformTarget>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||||
|
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>ARM</PlatformTarget>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE;NETFX_CORE;WINDOWS_UWP</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoWarn>;2008</NoWarn>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<UseVSHostingProcess>false</UseVSHostingProcess>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<Prefer32Bit>true</Prefer32Bit>
|
||||||
|
<UseDotNetNativeToolchain>true</UseDotNetNativeToolchain>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<!--A reference to the entire .Net Framework and Windows SDK are automatically included-->
|
||||||
|
<None Include="project.json" />
|
||||||
|
<SDKReference Include="MSTestFramework.Universal, Version=$(UnitTestPlatformVersion)" />
|
||||||
|
<SDKReference Include="TestPlatform.Universal, Version=$(UnitTestPlatformVersion)" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="UnitTestApp.xaml.cs">
|
||||||
|
<DependentUpon>UnitTestApp.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
|
<Compile Include="YogaNodeTest.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ApplicationDefinition Include="UnitTestApp.xaml">
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</ApplicationDefinition>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<AppxManifest Include="Package.appxmanifest">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</AppxManifest>
|
||||||
|
<None Include="Facebook.Yoga.Universal.Tests_TemporaryKey.pfx" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Content Include="Properties\UnitTestApp.rd.xml" />
|
||||||
|
<Content Include="Assets\LockScreenLogo.scale-200.png" />
|
||||||
|
<Content Include="Assets\SplashScreen.scale-200.png" />
|
||||||
|
<Content Include="Assets\Square150x150Logo.scale-200.png" />
|
||||||
|
<Content Include="Assets\Square44x44Logo.scale-200.png" />
|
||||||
|
<Content Include="Assets\Square44x44Logo.targetsize-24_altform-unplated.png" />
|
||||||
|
<Content Include="Assets\StoreLogo.png" />
|
||||||
|
<Content Include="Assets\Wide310x150Logo.scale-200.png" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\Facebook.Yoga\Facebook.Yoga.csproj">
|
||||||
|
<Project>{3aace384-fdec-4d91-a3b2-eeb21b46c9ad}</Project>
|
||||||
|
<Name>Facebook.Yoga</Name>
|
||||||
|
</ProjectReference>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Condition=" '$(VisualStudioVersion)' == '' or '$(VisualStudioVersion)' < '14.0' ">
|
||||||
|
<VisualStudioVersion>14.0</VisualStudioVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\Microsoft\WindowsXaml\v$(VisualStudioVersion)\Microsoft.Windows.UI.Xaml.CSharp.targets" />
|
||||||
|
<Import Project="$(SolutionDir)Build\Facebook.Yoga.NativeInterop.targets" Condition="Exists('$(SolutionDir)Build\Facebook.Yoga.NativeInterop.targets')" Label="ImportNativeInteropTargets" />
|
||||||
|
<Target Name="EnsureNativeInteropImports" BeforeTargets="PrepareForBuild">
|
||||||
|
<PropertyGroup>
|
||||||
|
<ErrorText>This project references a native interop target that is missing. The missing build target is {0}.</ErrorText>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Error Condition="!Exists('$(SolutionDir)Build\Facebook.Yoga.NativeInterop.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(SolutionDir)Build\Facebook.Yoga.NativeInterop.targets'))" />
|
||||||
|
</Target>
|
||||||
|
</Project>
|
@@ -0,0 +1,45 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Package
|
||||||
|
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
|
||||||
|
xmlns:mp="http://schemas.microsoft.com/appx/2014/phone/manifest"
|
||||||
|
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
|
||||||
|
IgnorableNamespaces="uap mp">
|
||||||
|
|
||||||
|
<Identity Name="6797a00b-cf19-41b1-bd06-467391a2a6e3"
|
||||||
|
Publisher="CN=anforste"
|
||||||
|
Version="1.0.0.0" />
|
||||||
|
|
||||||
|
<mp:PhoneIdentity PhoneProductId="6797a00b-cf19-41b1-bd06-467391a2a6e3" PhonePublisherId="00000000-0000-0000-0000-000000000000"/>
|
||||||
|
|
||||||
|
<Properties>
|
||||||
|
<DisplayName>Facebook.Yoga.Universal.Tests</DisplayName>
|
||||||
|
<PublisherDisplayName>anforste</PublisherDisplayName>
|
||||||
|
<Logo>Assets\StoreLogo.png</Logo>
|
||||||
|
</Properties>
|
||||||
|
|
||||||
|
<Dependencies>
|
||||||
|
<TargetDeviceFamily Name="Windows.Universal" MinVersion="10.0.0.0" MaxVersionTested="10.0.0.0" />
|
||||||
|
</Dependencies>
|
||||||
|
|
||||||
|
<Resources>
|
||||||
|
<Resource Language="x-generate" />
|
||||||
|
</Resources>
|
||||||
|
<Applications>
|
||||||
|
<Application Id="vstest.executionengine.universal.App"
|
||||||
|
Executable="$targetnametoken$.exe"
|
||||||
|
EntryPoint="Facebook.Yoga.Universal.Tests.App">
|
||||||
|
<uap:VisualElements
|
||||||
|
DisplayName="Facebook.Yoga.Universal.Tests"
|
||||||
|
Square150x150Logo="Assets\Square150x150Logo.png"
|
||||||
|
Square44x44Logo="Assets\Square44x44Logo.png"
|
||||||
|
Description="Facebook.Yoga.Universal.Tests"
|
||||||
|
BackgroundColor="transparent">
|
||||||
|
<uap:DefaultTile Wide310x150Logo="Assets\Wide310x150Logo.png"/>
|
||||||
|
<uap:SplashScreen Image="Assets\SplashScreen.png" />
|
||||||
|
</uap:VisualElements>
|
||||||
|
</Application>
|
||||||
|
</Applications>
|
||||||
|
<Capabilities>
|
||||||
|
<Capability Name="internetClient" />
|
||||||
|
</Capabilities>
|
||||||
|
</Package>
|
@@ -0,0 +1,30 @@
|
|||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("Facebook.Yoga.Universal.Tests")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("BlueJeans")]
|
||||||
|
[assembly: AssemblyProduct("Facebook.Yoga.Universal.Tests")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © BlueJeans 2016")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
[assembly: AssemblyMetadata("TargetPlatform","UAP")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
[assembly: ComVisible(false)]
|
@@ -0,0 +1,29 @@
|
|||||||
|
<!--
|
||||||
|
This file contains Runtime Directives used by .NET Native. The defaults here are suitable for most
|
||||||
|
developers. However, you can modify these parameters to modify the behavior of the .NET Native
|
||||||
|
optimizer.
|
||||||
|
|
||||||
|
Runtime Directives are documented at http://go.microsoft.com/fwlink/?LinkID=391919
|
||||||
|
|
||||||
|
To fully enable reflection for App1.MyClass and all of its public/private members
|
||||||
|
<Type Name="App1.MyClass" Dynamic="Required All"/>
|
||||||
|
|
||||||
|
To enable dynamic creation of the specific instantiation of AppClass<T> over System.Int32
|
||||||
|
<TypeInstantiation Name="App1.AppClass" Arguments="System.Int32" Activate="Required Public" />
|
||||||
|
|
||||||
|
Using the Namespace directive to apply reflection policy to all the types in a particular namespace
|
||||||
|
<Namespace Name="DataClasses.ViewModels" Seralize="All" />
|
||||||
|
-->
|
||||||
|
|
||||||
|
<Directives xmlns="http://schemas.microsoft.com/netfx/2013/01/metadata">
|
||||||
|
<Application>
|
||||||
|
<!--
|
||||||
|
An Assembly element with Name="*Application*" applies to all assemblies in
|
||||||
|
the application package. The asterisks are not wildcards.
|
||||||
|
-->
|
||||||
|
<Assembly Name="*Application*" Dynamic="Required All" />
|
||||||
|
<!-- Add your application specific runtime directives here. -->
|
||||||
|
|
||||||
|
|
||||||
|
</Application>
|
||||||
|
</Directives>
|
@@ -0,0 +1,8 @@
|
|||||||
|
<Application
|
||||||
|
x:Class="Facebook.Yoga.Universal.Tests.App"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
xmlns:local="using:Facebook.Yoga.Universal.Tests"
|
||||||
|
RequestedTheme="Light">
|
||||||
|
|
||||||
|
</Application>
|
102
csharp/Windows/Facebook.Yoga.Universal.Tests/UnitTestApp.xaml.cs
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Runtime.InteropServices.WindowsRuntime;
|
||||||
|
using Windows.ApplicationModel;
|
||||||
|
using Windows.ApplicationModel.Activation;
|
||||||
|
using Windows.Foundation;
|
||||||
|
using Windows.Foundation.Collections;
|
||||||
|
using Windows.UI.Xaml;
|
||||||
|
using Windows.UI.Xaml.Controls;
|
||||||
|
using Windows.UI.Xaml.Controls.Primitives;
|
||||||
|
using Windows.UI.Xaml.Data;
|
||||||
|
using Windows.UI.Xaml.Input;
|
||||||
|
using Windows.UI.Xaml.Media;
|
||||||
|
using Windows.UI.Xaml.Navigation;
|
||||||
|
|
||||||
|
namespace Facebook.Yoga.Universal.Tests
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Provides application-specific behavior to supplement the default Application class.
|
||||||
|
/// </summary>
|
||||||
|
sealed partial class App : Application
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Initializes the singleton application object. This is the first line of authored code
|
||||||
|
/// executed, and as such is the logical equivalent of main() or WinMain().
|
||||||
|
/// </summary>
|
||||||
|
public App()
|
||||||
|
{
|
||||||
|
this.InitializeComponent();
|
||||||
|
this.Suspending += OnSuspending;
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invoked when the application is launched normally by the end user. Other entry points
|
||||||
|
/// will be used such as when the application is launched to open a specific file.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="e">Details about the launch request and process.</param>
|
||||||
|
protected override void OnLaunched(LaunchActivatedEventArgs e)
|
||||||
|
{
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
if (System.Diagnostics.Debugger.IsAttached)
|
||||||
|
{
|
||||||
|
this.DebugSettings.EnableFrameRateCounter = true;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
Frame rootFrame = Window.Current.Content as Frame;
|
||||||
|
|
||||||
|
// Do not repeat app initialization when the Window already has content,
|
||||||
|
// just ensure that the window is active
|
||||||
|
if (rootFrame == null)
|
||||||
|
{
|
||||||
|
// Create a Frame to act as the navigation context and navigate to the first page
|
||||||
|
rootFrame = new Frame();
|
||||||
|
|
||||||
|
rootFrame.NavigationFailed += OnNavigationFailed;
|
||||||
|
|
||||||
|
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
|
||||||
|
{
|
||||||
|
//TODO: Load state from previously suspended application
|
||||||
|
}
|
||||||
|
|
||||||
|
// Place the frame in the current Window
|
||||||
|
Window.Current.Content = rootFrame;
|
||||||
|
}
|
||||||
|
|
||||||
|
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.CreateDefaultUI();
|
||||||
|
|
||||||
|
// Ensure the current window is active
|
||||||
|
Window.Current.Activate();
|
||||||
|
|
||||||
|
Microsoft.VisualStudio.TestPlatform.TestExecutor.UnitTestClient.Run(e.Arguments);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invoked when Navigation to a certain page fails
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">The Frame which failed navigation</param>
|
||||||
|
/// <param name="e">Details about the navigation failure</param>
|
||||||
|
void OnNavigationFailed(object sender, NavigationFailedEventArgs e)
|
||||||
|
{
|
||||||
|
throw new Exception("Failed to load Page " + e.SourcePageType.FullName);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Invoked when application execution is being suspended. Application state is saved
|
||||||
|
/// without knowing whether the application will be terminated or resumed with the contents
|
||||||
|
/// of memory still intact.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="sender">The source of the suspend request.</param>
|
||||||
|
/// <param name="e">Details about the suspend request.</param>
|
||||||
|
private void OnSuspending(object sender, SuspendingEventArgs e)
|
||||||
|
{
|
||||||
|
var deferral = e.SuspendingOperation.GetDeferral();
|
||||||
|
//TODO: Save application state and stop any background activity
|
||||||
|
deferral.Complete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
417
csharp/Windows/Facebook.Yoga.Universal.Tests/YogaNodeTest.cs
Normal file
@@ -0,0 +1,417 @@
|
|||||||
|
using System;
|
||||||
|
using Microsoft.VisualStudio.TestPlatform.UnitTestFramework;
|
||||||
|
using Facebook.Yoga;
|
||||||
|
|
||||||
|
namespace Facebook.Yoga.Universal.Tests
|
||||||
|
{
|
||||||
|
[TestClass]
|
||||||
|
public class YogaNodeTest
|
||||||
|
{
|
||||||
|
[TestMethod]
|
||||||
|
public void TestAddChildGetParent()
|
||||||
|
{
|
||||||
|
YogaNode parent = new YogaNode();
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
|
||||||
|
Assert.IsNull(child.Parent);
|
||||||
|
Assert.AreEqual(0, parent.Count);
|
||||||
|
|
||||||
|
parent.Insert(0, child);
|
||||||
|
|
||||||
|
Assert.AreEqual(1, parent.Count);
|
||||||
|
Assert.AreEqual(child, parent[0]);
|
||||||
|
Assert.AreEqual(parent, child.Parent);
|
||||||
|
|
||||||
|
parent.RemoveAt(0);
|
||||||
|
|
||||||
|
Assert.IsNull(child.Parent);
|
||||||
|
Assert.AreEqual(0, parent.Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestChildren()
|
||||||
|
{
|
||||||
|
YogaNode parent = new YogaNode();
|
||||||
|
foreach (YogaNode node in parent)
|
||||||
|
{
|
||||||
|
Assert.Fail(node.ToString());
|
||||||
|
}
|
||||||
|
|
||||||
|
YogaNode child0 = new YogaNode();
|
||||||
|
Assert.AreEqual(-1, parent.IndexOf(child0));
|
||||||
|
parent.Insert(0, child0);
|
||||||
|
foreach (YogaNode node in parent)
|
||||||
|
{
|
||||||
|
Assert.AreEqual(0, parent.IndexOf(node));
|
||||||
|
}
|
||||||
|
|
||||||
|
YogaNode child1 = new YogaNode();
|
||||||
|
parent.Insert(1, child1);
|
||||||
|
int index = 0;
|
||||||
|
foreach (YogaNode node in parent)
|
||||||
|
{
|
||||||
|
Assert.AreEqual(index++, parent.IndexOf(node));
|
||||||
|
}
|
||||||
|
|
||||||
|
parent.RemoveAt(0);
|
||||||
|
Assert.AreEqual(-1, parent.IndexOf(child0));
|
||||||
|
Assert.AreEqual(0, parent.IndexOf(child1));
|
||||||
|
|
||||||
|
parent.Clear();
|
||||||
|
Assert.AreEqual(0, parent.Count);
|
||||||
|
|
||||||
|
parent.Clear();
|
||||||
|
Assert.AreEqual(0, parent.Count);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestRemoveAtFromEmpty()
|
||||||
|
{
|
||||||
|
YogaNode parent = new YogaNode();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
parent.RemoveAt(0);
|
||||||
|
}
|
||||||
|
catch (System.NullReferenceException)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.Fail("Excepted exception of type 'System.NullReferenceException'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestRemoveAtOutOfRange()
|
||||||
|
{
|
||||||
|
YogaNode parent = new YogaNode();
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
parent.Insert(0, child);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
parent.RemoveAt(1);
|
||||||
|
}
|
||||||
|
catch (System.ArgumentOutOfRangeException)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.Fail("Excepted exception of type 'System.ArgumentOutOfRangeException'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestCannotAddChildToMultipleParents()
|
||||||
|
{
|
||||||
|
YogaNode parent1 = new YogaNode();
|
||||||
|
YogaNode parent2 = new YogaNode();
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
|
||||||
|
parent1.Insert(0, child);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
parent2.Insert(0, child);
|
||||||
|
}
|
||||||
|
catch (System.InvalidOperationException)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.Fail("Excepted exception of type 'System.InvalidOperationException'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestReset()
|
||||||
|
{
|
||||||
|
int instanceCount = YogaNode.GetInstanceCount();
|
||||||
|
YogaNode node = new YogaNode();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
node.Reset();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestResetParent()
|
||||||
|
{
|
||||||
|
YogaNode parent = new YogaNode();
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
parent.Insert(0, child);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
parent.Reset();
|
||||||
|
}
|
||||||
|
catch (System.InvalidOperationException)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.Fail("Excepted exception of type 'System.InvalidOperationException'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestResetChild()
|
||||||
|
{
|
||||||
|
YogaNode parent = new YogaNode();
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
parent.Insert(0, child);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
child.Reset();
|
||||||
|
}
|
||||||
|
catch (System.InvalidOperationException)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.Fail("Excepted exception of type 'System.InvalidOperationException'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestClear()
|
||||||
|
{
|
||||||
|
int instanceCount = YogaNode.GetInstanceCount();
|
||||||
|
YogaNode parent = new YogaNode();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
Assert.AreEqual(instanceCount + 2, YogaNode.GetInstanceCount());
|
||||||
|
parent.Insert(0, child);
|
||||||
|
Assert.AreEqual(1, parent.Count);
|
||||||
|
Assert.AreEqual(parent, child.Parent);
|
||||||
|
parent.Clear();
|
||||||
|
Assert.AreEqual(0, parent.Count);
|
||||||
|
Assert.IsNull(child.Parent);
|
||||||
|
Assert.AreEqual(instanceCount + 2, YogaNode.GetInstanceCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestMeasureFunc()
|
||||||
|
{
|
||||||
|
YogaNode node = new YogaNode();
|
||||||
|
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||||
|
return MeasureOutput.Make(100, 150);
|
||||||
|
});
|
||||||
|
node.CalculateLayout();
|
||||||
|
Assert.AreEqual(100, node.LayoutWidth);
|
||||||
|
Assert.AreEqual(150, node.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestMeasureFuncWithFloat()
|
||||||
|
{
|
||||||
|
YogaNode node = new YogaNode();
|
||||||
|
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||||
|
return MeasureOutput.Make(123.4f, 81.7f);
|
||||||
|
});
|
||||||
|
node.CalculateLayout();
|
||||||
|
Assert.AreEqual(123, node.LayoutWidth);
|
||||||
|
Assert.AreEqual(81, node.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestChildWithMeasureFunc()
|
||||||
|
{
|
||||||
|
YogaNode node = new YogaNode();
|
||||||
|
|
||||||
|
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||||
|
return MeasureOutput.Make(100, 150);
|
||||||
|
});
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
node.Insert(0, child);
|
||||||
|
}
|
||||||
|
catch (System.InvalidOperationException)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.Fail("Excepted exception of type 'System.InvalidOperationException'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestMeasureFuncWithChild()
|
||||||
|
{
|
||||||
|
YogaNode node = new YogaNode();
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
node.Insert(0, child);
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
node.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||||
|
return MeasureOutput.Make(100, 150);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
catch (System.InvalidOperationException)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Assert.Fail("Excepted exception of type 'System.InvalidOperationException'.");
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestPrint()
|
||||||
|
{
|
||||||
|
YogaNode parent = new YogaNode();
|
||||||
|
parent.Width = 100;
|
||||||
|
parent.Height = 120;
|
||||||
|
YogaNode child0 = new YogaNode();
|
||||||
|
child0.Width = 30;
|
||||||
|
child0.Height = 40;
|
||||||
|
YogaNode child1 = new YogaNode();
|
||||||
|
child1.Width = 35;
|
||||||
|
child1.Height = 45;
|
||||||
|
parent.Insert(0, child0);
|
||||||
|
parent.Insert(0, child1);
|
||||||
|
parent.CalculateLayout();
|
||||||
|
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]
|
||||||
|
public void TestCopyStyle()
|
||||||
|
{
|
||||||
|
YogaNode node0 = new YogaNode();
|
||||||
|
Assert.IsTrue(YogaConstants.IsUndefined(node0.MaxHeight));
|
||||||
|
|
||||||
|
YogaNode node1 = new YogaNode();
|
||||||
|
node1.MaxHeight = 100;
|
||||||
|
|
||||||
|
node0.CopyStyle(node1);
|
||||||
|
Assert.AreEqual(100, node0.MaxHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
#if !UNITY_EDITOR
|
||||||
|
private void ForceGC()
|
||||||
|
{
|
||||||
|
GC.Collect(GC.MaxGeneration);
|
||||||
|
GC.WaitForPendingFinalizers();
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestDestructor()
|
||||||
|
{
|
||||||
|
ForceGC();
|
||||||
|
int instanceCount = YogaNode.GetInstanceCount();
|
||||||
|
TestDestructorForGC(instanceCount);
|
||||||
|
ForceGC();
|
||||||
|
Assert.AreEqual(instanceCount, YogaNode.GetInstanceCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TestDestructorForGC(int instanceCount)
|
||||||
|
{
|
||||||
|
YogaNode node = new YogaNode();
|
||||||
|
Assert.IsNotNull(node);
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
node = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestDestructorWithChildren()
|
||||||
|
{
|
||||||
|
ForceGC();
|
||||||
|
int instanceCount = YogaNode.GetInstanceCount();
|
||||||
|
TestDestructorWithChildrenForGC1(instanceCount);
|
||||||
|
ForceGC();
|
||||||
|
Assert.AreEqual(instanceCount, YogaNode.GetInstanceCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TestDestructorWithChildrenForGC1(int instanceCount)
|
||||||
|
{
|
||||||
|
YogaNode node = new YogaNode();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
|
||||||
|
TestDestructorWithChildrenForGC2(node, instanceCount + 1);
|
||||||
|
ForceGC();
|
||||||
|
Assert.AreEqual(instanceCount + 2, YogaNode.GetInstanceCount());
|
||||||
|
|
||||||
|
TestDestructorWithChildrenForGC2(node, instanceCount + 2);
|
||||||
|
ForceGC();
|
||||||
|
Assert.AreEqual(instanceCount + 3, YogaNode.GetInstanceCount());
|
||||||
|
|
||||||
|
node = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TestDestructorWithChildrenForGC2(YogaNode parent, int instanceCount)
|
||||||
|
{
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
|
||||||
|
parent.Insert(0, child);
|
||||||
|
child = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestParentDestructor()
|
||||||
|
{
|
||||||
|
ForceGC();
|
||||||
|
int instanceCount = YogaNode.GetInstanceCount();
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
|
||||||
|
TestParentDestructorForGC(child, instanceCount + 1);
|
||||||
|
ForceGC();
|
||||||
|
|
||||||
|
Assert.IsNull(child.Parent);
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TestParentDestructorForGC(YogaNode child, int instanceCount)
|
||||||
|
{
|
||||||
|
YogaNode parent = new YogaNode();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
parent.Insert(0, child);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestClearWithChildDestructor()
|
||||||
|
{
|
||||||
|
ForceGC();
|
||||||
|
int instanceCount = YogaNode.GetInstanceCount();
|
||||||
|
YogaNode node = new YogaNode();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
TestClearWithChildDestructorForGC(node, instanceCount + 1);
|
||||||
|
ForceGC();
|
||||||
|
Assert.AreEqual(instanceCount + 2, YogaNode.GetInstanceCount());
|
||||||
|
node.Clear();
|
||||||
|
Assert.AreEqual(0, node.Count);
|
||||||
|
ForceGC();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TestClearWithChildDestructorForGC(YogaNode parent, int instanceCount)
|
||||||
|
{
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
parent.Insert(0, child);
|
||||||
|
}
|
||||||
|
|
||||||
|
[TestMethod]
|
||||||
|
public void TestMeasureFuncWithDestructor()
|
||||||
|
{
|
||||||
|
ForceGC();
|
||||||
|
int instanceCount = YogaNode.GetInstanceCount();
|
||||||
|
YogaNode parent = new YogaNode();
|
||||||
|
Assert.AreEqual(instanceCount + 1, YogaNode.GetInstanceCount());
|
||||||
|
TestMeasureFuncWithDestructorForGC(parent);
|
||||||
|
ForceGC();
|
||||||
|
Assert.AreEqual(instanceCount + 2, YogaNode.GetInstanceCount());
|
||||||
|
parent.CalculateLayout();
|
||||||
|
Assert.AreEqual(120, (int)parent.LayoutWidth);
|
||||||
|
Assert.AreEqual(130, (int)parent.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void TestMeasureFuncWithDestructorForGC(YogaNode parent)
|
||||||
|
{
|
||||||
|
YogaNode child = new YogaNode();
|
||||||
|
parent.Insert(0, child);
|
||||||
|
child.SetMeasureFunction((_, width, widthMode, height, heightMode) => {
|
||||||
|
return MeasureOutput.Make(120, 130);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
16
csharp/Windows/Facebook.Yoga.Universal.Tests/project.json
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NETCore.UniversalWindowsPlatform": "5.2.2"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"uap10.0": {}
|
||||||
|
},
|
||||||
|
"runtimes": {
|
||||||
|
"win10-arm": {},
|
||||||
|
"win10-arm-aot": {},
|
||||||
|
"win10-x86": {},
|
||||||
|
"win10-x86-aot": {},
|
||||||
|
"win10-x64": {},
|
||||||
|
"win10-x64-aot": {}
|
||||||
|
}
|
||||||
|
}
|
105
csharp/Windows/Facebook.Yoga.Universal.sln
Normal file
@@ -0,0 +1,105 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 14
|
||||||
|
VisualStudioVersion = 14.0.25420.1
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{5289E508-8386-45A1-A12B-258A5899CD45}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Native", "Native", "{51A8E803-C084-431F-9130-F277481C2BB2}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NETStandard", "NETStandard", "{DCF7899B-A487-49C0-BCDE-DC088B6750C2}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yoga", "..\Yoga\Yoga.vcxproj", "{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{39A2FFDA-C093-4FA6-8143-45B5019E7DAC}"
|
||||||
|
EndProject
|
||||||
|
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared", "..\Facebook.Yoga\Facebook.Yoga.Shared.shproj", "{91C42D32-291D-4B72-90B4-551663D60B8B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga", "Facebook.Yoga\Facebook.Yoga.csproj", "{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5} = {0446C86B-F47B-4C46-B673-C7AE0CFF35D5}
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared.Tests", "..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.shproj", "{4EDC82D9-A201-4831-8FE0-98F468F8E4AE}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Universal.Tests", "Facebook.Yoga.Universal.Tests\Facebook.Yoga.Universal.Tests.csproj", "{0C76D2FE-6767-44FE-B03D-21B2076BAA73}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||||
|
..\Facebook.Yoga\Facebook.Yoga.Shared.projitems*{3aace384-fdec-4d91-a3b2-eeb21b46c9ad}*SharedItemsImports = 4
|
||||||
|
..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems*{4edc82d9-a201-4831-8fe0-98f468f8e4ae}*SharedItemsImports = 13
|
||||||
|
..\Facebook.Yoga\Facebook.Yoga.Shared.projitems*{91c42d32-291d-4b72-90b4-551663d60b8b}*SharedItemsImports = 13
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|ARM = Debug|ARM
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|ARM = Release|ARM
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x64.Build.0 = Release|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x64.Build.0 = Release|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x86.Build.0 = Release|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x64.Deploy.0 = Debug|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x86.Deploy.0 = Debug|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|Any CPU.ActiveCfg = Release|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|ARM.Deploy.0 = Release|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x64.Build.0 = Release|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x64.Deploy.0 = Release|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x86.Build.0 = Release|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x86.Deploy.0 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5} = {51A8E803-C084-431F-9130-F277481C2BB2}
|
||||||
|
{91C42D32-291D-4B72-90B4-551663D60B8B} = {39A2FFDA-C093-4FA6-8143-45B5019E7DAC}
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD} = {DCF7899B-A487-49C0-BCDE-DC088B6750C2}
|
||||||
|
{4EDC82D9-A201-4831-8FE0-98F468F8E4AE} = {39A2FFDA-C093-4FA6-8143-45B5019E7DAC}
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73} = {5289E508-8386-45A1-A12B-258A5899CD45}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
125
csharp/Windows/Facebook.Yoga.sln
Normal file
@@ -0,0 +1,125 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio 14
|
||||||
|
VisualStudioVersion = 14.0.25420.1
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{5289E508-8386-45A1-A12B-258A5899CD45}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Native", "Native", "{51A8E803-C084-431F-9130-F277481C2BB2}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NETStandard", "NETStandard", "{DCF7899B-A487-49C0-BCDE-DC088B6750C2}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "yoga", "..\Yoga\Yoga.vcxproj", "{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{39A2FFDA-C093-4FA6-8143-45B5019E7DAC}"
|
||||||
|
EndProject
|
||||||
|
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared", "..\Facebook.Yoga\Facebook.Yoga.Shared.shproj", "{91C42D32-291D-4B72-90B4-551663D60B8B}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga", "Facebook.Yoga\Facebook.Yoga.csproj", "{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}"
|
||||||
|
ProjectSection(ProjectDependencies) = postProject
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5} = {0446C86B-F47B-4C46-B673-C7AE0CFF35D5}
|
||||||
|
EndProjectSection
|
||||||
|
EndProject
|
||||||
|
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "Facebook.Yoga.Shared.Tests", "..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.shproj", "{4EDC82D9-A201-4831-8FE0-98F468F8E4AE}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Desktop.Tests", "Facebook.Yoga.Desktop.Tests\Facebook.Yoga.Desktop.Tests.csproj", "{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Facebook.Yoga.Universal.Tests", "Facebook.Yoga.Universal.Tests\Facebook.Yoga.Universal.Tests.csproj", "{0C76D2FE-6767-44FE-B03D-21B2076BAA73}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||||
|
..\Facebook.Yoga\Facebook.Yoga.Shared.projitems*{3aace384-fdec-4d91-a3b2-eeb21b46c9ad}*SharedItemsImports = 4
|
||||||
|
..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems*{4edc82d9-a201-4831-8fe0-98f468f8e4ae}*SharedItemsImports = 13
|
||||||
|
..\Facebook.Yoga\Facebook.Yoga.Shared.projitems*{91c42d32-291d-4b72-90b4-551663d60b8b}*SharedItemsImports = 13
|
||||||
|
..\tests\Facebook.Yoga\Facebook.Yoga.Shared.Tests.projitems*{ac23f444-5545-4196-8b9f-5c1f6b3e7fb3}*SharedItemsImports = 4
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Debug|ARM = Debug|ARM
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Debug|x86 = Debug|x86
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
Release|ARM = Release|ARM
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
Release|x86 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|Any CPU.ActiveCfg = Debug|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x86.ActiveCfg = Debug|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Debug|x86.Build.0 = Debug|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|Any CPU.ActiveCfg = Release|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x64.Build.0 = Release|x64
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x86.ActiveCfg = Release|Win32
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5}.Release|x86.Build.0 = Release|Win32
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x64.Build.0 = Release|x64
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}.Release|x86.Build.0 = Release|x86
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|ARM.ActiveCfg = Debug|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|ARM.Build.0 = Debug|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|ARM.ActiveCfg = Release|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|ARM.Build.0 = Release|Any CPU
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|x64.Build.0 = Release|x64
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3}.Release|x86.Build.0 = Release|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|Any CPU.ActiveCfg = Debug|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|ARM.ActiveCfg = Debug|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|ARM.Build.0 = Debug|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|ARM.Deploy.0 = Debug|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x64.Deploy.0 = Debug|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x86.ActiveCfg = Debug|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x86.Build.0 = Debug|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Debug|x86.Deploy.0 = Debug|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|Any CPU.ActiveCfg = Release|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|ARM.ActiveCfg = Release|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|ARM.Build.0 = Release|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|ARM.Deploy.0 = Release|ARM
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x64.Build.0 = Release|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x64.Deploy.0 = Release|x64
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x86.ActiveCfg = Release|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x86.Build.0 = Release|x86
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73}.Release|x86.Deploy.0 = Release|x86
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(NestedProjects) = preSolution
|
||||||
|
{0446C86B-F47B-4C46-B673-C7AE0CFF35D5} = {51A8E803-C084-431F-9130-F277481C2BB2}
|
||||||
|
{91C42D32-291D-4B72-90B4-551663D60B8B} = {39A2FFDA-C093-4FA6-8143-45B5019E7DAC}
|
||||||
|
{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD} = {DCF7899B-A487-49C0-BCDE-DC088B6750C2}
|
||||||
|
{4EDC82D9-A201-4831-8FE0-98F468F8E4AE} = {39A2FFDA-C093-4FA6-8143-45B5019E7DAC}
|
||||||
|
{AC23F444-5545-4196-8B9F-5C1F6B3E7FB3} = {5289E508-8386-45A1-A12B-258A5899CD45}
|
||||||
|
{0C76D2FE-6767-44FE-B03D-21B2076BAA73} = {5289E508-8386-45A1-A12B-258A5899CD45}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
113
csharp/Windows/Facebook.Yoga/Facebook.Yoga.csproj
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{3AACE384-FDEC-4D91-A3B2-EEB21B46C9AD}</ProjectGuid>
|
||||||
|
<OutputType>Library</OutputType>
|
||||||
|
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||||
|
<RootNamespace>Facebook.Yoga</RootNamespace>
|
||||||
|
<AssemblyName>Facebook.Yoga</AssemblyName>
|
||||||
|
<DefaultLanguage>en-US</DefaultLanguage>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||||
|
<TargetFrameworkProfile>
|
||||||
|
</TargetFrameworkProfile>
|
||||||
|
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|ARM'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\ARM\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<NoStdLib>true</NoStdLib>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>ARM</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|ARM'">
|
||||||
|
<OutputPath>bin\ARM\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoStdLib>true</NoStdLib>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>ARM</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x64\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<NoStdLib>true</NoStdLib>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<OutputPath>bin\x64\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoStdLib>true</NoStdLib>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x64</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<OutputPath>bin\x86\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<NoStdLib>true</NoStdLib>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
|
||||||
|
<OutputPath>bin\x86\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<NoStdLib>true</NoStdLib>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<PlatformTarget>x86</PlatformTarget>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<CodeAnalysisRuleSet>MinimumRecommendedRules.ruleset</CodeAnalysisRuleSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<!-- A reference to the entire .NET Framework is automatically included -->
|
||||||
|
<None Include="project.json" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="..\..\Facebook.Yoga\Facebook.Yoga.Shared.projitems" Label="Shared" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||||
|
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||||
|
Other similar extension points exist, see Microsoft.Common.targets.
|
||||||
|
<Target Name="BeforeBuild">
|
||||||
|
</Target>
|
||||||
|
<Target Name="AfterBuild">
|
||||||
|
</Target>
|
||||||
|
-->
|
||||||
|
</Project>
|
@@ -11,22 +11,19 @@ using System.Reflection;
|
|||||||
using System.Resources;
|
using System.Resources;
|
||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
// General Information about an assembly is controlled through the following
|
[assembly: AssemblyTitle("Facebook.Yoga")]
|
||||||
// set of attributes. Change these attribute values to modify the information
|
|
||||||
// associated with an assembly.
|
|
||||||
[assembly: AssemblyConfiguration("")]
|
[assembly: AssemblyConfiguration("")]
|
||||||
[assembly: AssemblyCompany("Facebook, Inc.")]
|
[assembly: AssemblyCompany("Facebook, Inc.")]
|
||||||
[assembly: AssemblyProduct("Facebook.Yoga")]
|
[assembly: AssemblyProduct("Facebook.Yoga")]
|
||||||
[assembly: AssemblyTrademark("Copyright (c) 2014-present, Facebook, Inc.")]
|
[assembly: AssemblyDescription("A subset of CSS's flexbox layout algorithm and box model.")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright (c) 2014-present, Facebook, Inc.")]
|
||||||
|
|
||||||
// Setting ComVisible to false makes the types in this assembly not visible
|
|
||||||
// to COM components. If you need to access a type in this assembly from
|
|
||||||
// COM, set the ComVisible attribute to true on that type.
|
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
|
||||||
[assembly: Guid("75bb7605-e54b-4ede-8f5a-ff1f24464236")]
|
[assembly: Guid("75bb7605-e54b-4ede-8f5a-ff1f24464236")]
|
||||||
|
|
||||||
[assembly: NeutralResourcesLanguage("en")]
|
[assembly: NeutralResourcesLanguage("en")]
|
||||||
|
|
||||||
[assembly: AssemblyVersion("3.0.0.0")]
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||||
|
|
12
csharp/Windows/Facebook.Yoga/project.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
"dependencies": {
|
||||||
|
"Microsoft.NETCore.Portable.Compatibility": "1.0.1",
|
||||||
|
"NETStandard.Library": "1.6.0"
|
||||||
|
},
|
||||||
|
"frameworks": {
|
||||||
|
"netstandard1.1": {}
|
||||||
|
},
|
||||||
|
"language": "en",
|
||||||
|
"supports": {},
|
||||||
|
"version": "3.0.0-*"
|
||||||
|
}
|
BIN
csharp/Yoga/Yoga.rc
Normal file
@@ -1,10 +1,18 @@
|
|||||||
<?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">
|
<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|ARM">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>ARM</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
<ProjectConfiguration Include="Debug|Win32">
|
||||||
<Configuration>Debug</Configuration>
|
<Configuration>Debug</Configuration>
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
</ProjectConfiguration>
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|ARM">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>ARM</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
<ProjectConfiguration Include="Release|Win32">
|
||||||
<Configuration>Release</Configuration>
|
<Configuration>Release</Configuration>
|
||||||
<Platform>Win32</Platform>
|
<Platform>Win32</Platform>
|
||||||
@@ -23,7 +31,8 @@
|
|||||||
<Keyword>Win32Proj</Keyword>
|
<Keyword>Win32Proj</Keyword>
|
||||||
<ProjectName>yoga</ProjectName>
|
<ProjectName>yoga</ProjectName>
|
||||||
<RootNamespace>Yoga</RootNamespace>
|
<RootNamespace>Yoga</RootNamespace>
|
||||||
<WindowsTargetPlatformVersion>10.0.14393.0</WindowsTargetPlatformVersion>
|
<WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion>
|
||||||
|
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||||
@@ -32,6 +41,12 @@
|
|||||||
<PlatformToolset>v140</PlatformToolset>
|
<PlatformToolset>v140</PlatformToolset>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v140</PlatformToolset>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
@@ -39,6 +54,13 @@
|
|||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="Configuration">
|
||||||
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<PlatformToolset>v140</PlatformToolset>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
@@ -60,9 +82,15 @@
|
|||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
|
<ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'" Label="PropertySheets">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
</ImportGroup>
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
@@ -72,15 +100,33 @@
|
|||||||
<PropertyGroup Label="UserMacros" />
|
<PropertyGroup Label="UserMacros" />
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<OutDir>bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>obj\$(PlatformTarget)\$(Configuration)\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<OutDir>bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>obj\$(PlatformTarget)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
<OutDir>bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>obj\$(PlatformTarget)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>obj\$(PlatformTarget)\$(Configuration)\</IntDir>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||||
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>obj\$(PlatformTarget)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
<OutDir>bin\$(PlatformTarget)\$(Configuration)\</OutDir>
|
||||||
|
<IntDir>obj\$(PlatformTarget)\$(Configuration)\</IntDir>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
@@ -97,12 +143,26 @@
|
|||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
</Link>
|
</Link>
|
||||||
</ItemDefinitionGroup>
|
</ItemDefinitionGroup>
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<PrecompiledHeader>
|
<PrecompiledHeader>
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
|
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;YOGA_EXPORTS;FB_ASSERTIONS_ENABLED=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
|
<ClCompile>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;YOGA_EXPORTS;FB_ASSERTIONS_ENABLED=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;YOGA_EXPORTS;FB_ASSERTIONS_ENABLED=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>$(ProjectDir)..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
@@ -115,8 +175,25 @@
|
|||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
</PrecompiledHeader>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;YOGA_EXPORTS;FB_ASSERTIONS_ENABLED=0;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<AdditionalIncludeDirectories>$(ProjectDir)..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||||
|
<ClCompile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
@@ -134,8 +211,7 @@
|
|||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PrecompiledHeader>
|
<PrecompiledHeader>NotUsing</PrecompiledHeader>
|
||||||
</PrecompiledHeader>
|
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
@@ -154,6 +230,7 @@
|
|||||||
<ClInclude Include="..\..\yoga\Yoga.h" />
|
<ClInclude Include="..\..\yoga\Yoga.h" />
|
||||||
<ClInclude Include="..\..\yoga\YGMacros.h" />
|
<ClInclude Include="..\..\yoga\YGMacros.h" />
|
||||||
<ClInclude Include="..\..\yoga\YGNodeList.h" />
|
<ClInclude Include="..\..\yoga\YGNodeList.h" />
|
||||||
|
<ClInclude Include="resource.h" />
|
||||||
<ClInclude Include="YGInterop.h" />
|
<ClInclude Include="YGInterop.h" />
|
||||||
<ClInclude Include="stdafx.h" />
|
<ClInclude Include="stdafx.h" />
|
||||||
<ClInclude Include="targetver.h" />
|
<ClInclude Include="targetver.h" />
|
||||||
@@ -164,21 +241,30 @@
|
|||||||
<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>
|
||||||
|
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">false</CompileAsManaged>
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|ARM'">
|
||||||
|
</PrecompiledHeader>
|
||||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged>
|
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</CompileAsManaged>
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
|
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</CompileAsManaged>
|
||||||
|
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">false</CompileAsManaged>
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|ARM'">
|
||||||
|
</PrecompiledHeader>
|
||||||
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged>
|
<CompileAsManaged Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</CompileAsManaged>
|
||||||
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
</PrecompiledHeader>
|
</PrecompiledHeader>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="stdafx.cpp" />
|
<ClCompile Include="stdafx.cpp" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="Yoga.rc" />
|
||||||
|
</ItemGroup>
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
<ImportGroup Label="ExtensionTargets">
|
<ImportGroup Label="ExtensionTargets">
|
||||||
</ImportGroup>
|
</ImportGroup>
|
||||||
</Project>
|
</Project>
|
@@ -33,6 +33,9 @@
|
|||||||
<ClInclude Include="YGInterop.h">
|
<ClInclude Include="YGInterop.h">
|
||||||
<Filter>Header Files</Filter>
|
<Filter>Header Files</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="resource.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClCompile Include="stdafx.cpp">
|
<ClCompile Include="stdafx.cpp">
|
||||||
@@ -51,4 +54,9 @@
|
|||||||
<Filter>Source Files</Filter>
|
<Filter>Source Files</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
<ItemGroup>
|
||||||
|
<ResourceCompile Include="Yoga.rc">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</ResourceCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
14
csharp/Yoga/resource.h
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
//{{NO_DEPENDENCIES}}
|
||||||
|
// Microsoft Visual C++ generated include file.
|
||||||
|
// Used by Yoga.rc
|
||||||
|
|
||||||
|
// Next default values for new objects
|
||||||
|
//
|
||||||
|
#ifdef APSTUDIO_INVOKED
|
||||||
|
#ifndef APSTUDIO_READONLY_SYMBOLS
|
||||||
|
#define _APS_NEXT_RESOURCE_VALUE 101
|
||||||
|
#define _APS_NEXT_COMMAND_VALUE 40001
|
||||||
|
#define _APS_NEXT_CONTROL_VALUE 1001
|
||||||
|
#define _APS_NEXT_SYMED_VALUE 101
|
||||||
|
#endif
|
||||||
|
#endif
|
38
csharp/nuget/Facebook.Yoga.Native.nuspec
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>Facebook.Yoga.Native</id>
|
||||||
|
<version>1.0.1-pre</version>
|
||||||
|
<title>Facebook.Yoga.Native</title>
|
||||||
|
<authors>Facebook</authors>
|
||||||
|
<owners>Facebook</owners>
|
||||||
|
<licenseUrl>https://github.com/facebook/css-layout/blob/master/LICENSE</licenseUrl>
|
||||||
|
<projectUrl>https://github.com/facebook/css-layout</projectUrl>
|
||||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
<description>A subset of CSS's flexbox layout algorithm and box model.</description>
|
||||||
|
<copyright>Copyright 2016 Facebook</copyright>
|
||||||
|
<tags>native flexbox flex-box css layout css-layout yoga facebook</tags>
|
||||||
|
<dependencies>
|
||||||
|
<group targetFramework=".NETStandard1.0" />
|
||||||
|
</dependencies>
|
||||||
|
</metadata>
|
||||||
|
|
||||||
|
<files>
|
||||||
|
<!-- build -->
|
||||||
|
<file src="Facebook.Yoga.Native.targets" target="build\netstandard1.0"/>
|
||||||
|
|
||||||
|
<!-- lib -->
|
||||||
|
<file src="_._" target="lib\netstandard1.0"/>
|
||||||
|
|
||||||
|
<!-- Native -->
|
||||||
|
<file src="..\Yoga\bin\x86\Release\Yoga.dll" target="runtimes\win-x86\native"/>
|
||||||
|
<file src="..\Yoga\bin\x86\Release\Yoga.pdb" target="runtimes\win-x86\native"/>
|
||||||
|
|
||||||
|
<file src="..\Yoga\bin\x64\Release\Yoga.dll" target="runtimes\win-x64\native"/>
|
||||||
|
<file src="..\Yoga\bin\x64\Release\Yoga.pdb" target="runtimes\win-x64\native"/>
|
||||||
|
|
||||||
|
<file src="..\Yoga\bin\ARM\Release\Yoga.dll" target="runtimes\win8-arm\native"/>
|
||||||
|
<file src="..\Yoga\bin\ARM\Release\Yoga.pdb" target="runtimes\win8-arm\native"/>
|
||||||
|
</files>
|
||||||
|
|
||||||
|
</package>
|
36
csharp/nuget/Facebook.Yoga.Native.targets
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'AnyCPU'">
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x86\native\*">
|
||||||
|
<Link>x86\%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x64\native\*">
|
||||||
|
<Link>x64\%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'x86'">
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x86\native\*">
|
||||||
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'x64'">
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x64\native\*">
|
||||||
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'ARM'">
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win8-arm\native\*">
|
||||||
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
46
csharp/nuget/Facebook.Yoga.nuspec
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
|
||||||
|
<metadata>
|
||||||
|
<id>Facebook.Yoga</id>
|
||||||
|
<version>1.0.1-pre</version>
|
||||||
|
<title>Facebook.Yoga</title>
|
||||||
|
<authors>Facebook</authors>
|
||||||
|
<owners>Facebook</owners>
|
||||||
|
<licenseUrl>https://github.com/facebook/css-layout/blob/master/LICENSE</licenseUrl>
|
||||||
|
<projectUrl>https://github.com/facebook/css-layout</projectUrl>
|
||||||
|
<requireLicenseAcceptance>false</requireLicenseAcceptance>
|
||||||
|
<description>A subset of CSS's flexbox layout algorithm and box model.</description>
|
||||||
|
<copyright>Copyright 2016 Facebook</copyright>
|
||||||
|
<tags>flexbox flex-box css layout css-layout yoga facebook native</tags>
|
||||||
|
<dependencies>
|
||||||
|
<group targetFramework=".NETStandard1.1" />
|
||||||
|
</dependencies>
|
||||||
|
</metadata>
|
||||||
|
<files>
|
||||||
|
<!-- build -->
|
||||||
|
<file src="Facebook.Yoga.targets" target="build\netstandard"/>
|
||||||
|
|
||||||
|
<!-- lib -->
|
||||||
|
<file src="..\Windows\Facebook.Yoga\bin\Release\Facebook.Yoga.dll" target="lib\netstandard"/>
|
||||||
|
|
||||||
|
<!-- runtimes -->
|
||||||
|
<file src="..\Windows\Facebook.Yoga\bin\x86\Release\Facebook.Yoga.dll" target="runtimes\win-x86\lib\netstandard"/>
|
||||||
|
<file src="..\Windows\Facebook.Yoga\bin\x86\Release\Facebook.Yoga.pdb" target="runtimes\win-x86\lib\netstandard"/>
|
||||||
|
|
||||||
|
<file src="..\Windows\Facebook.Yoga\bin\x64\Release\Facebook.Yoga.dll" target="runtimes\win-x64\lib\netstandard"/>
|
||||||
|
<file src="..\Windows\Facebook.Yoga\bin\x64\Release\Facebook.Yoga.pdb" target="runtimes\win-x64\lib\netstandard"/>
|
||||||
|
|
||||||
|
<file src="..\Windows\Facebook.Yoga\bin\ARM\Release\Facebook.Yoga.dll" target="runtimes\win8-arm\lib\netstandard"/>
|
||||||
|
<file src="..\Windows\Facebook.Yoga\bin\ARM\Release\Facebook.Yoga.pdb" target="runtimes\win8-arm\lib\netstandard"/>
|
||||||
|
|
||||||
|
<!-- Native -->
|
||||||
|
<file src="..\Yoga\bin\x86\Release\Yoga.dll" target="runtimes\win-x86\native"/>
|
||||||
|
<file src="..\Yoga\bin\x86\Release\Yoga.pdb" target="runtimes\win-x86\native"/>
|
||||||
|
|
||||||
|
<file src="..\Yoga\bin\x64\Release\Yoga.dll" target="runtimes\win-x64\native"/>
|
||||||
|
<file src="..\Yoga\bin\x64\Release\Yoga.pdb" target="runtimes\win-x64\native"/>
|
||||||
|
|
||||||
|
<file src="..\Yoga\bin\ARM\Release\Yoga.dll" target="runtimes\win8-arm\native"/>
|
||||||
|
<file src="..\Yoga\bin\ARM\Release\Yoga.pdb" target="runtimes\win8-arm\native"/>
|
||||||
|
</files>
|
||||||
|
</package>
|
51
csharp/nuget/Facebook.Yoga.targets
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
|
<Project ToolsVersion="12.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'AnyCPU'">
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x86\native\*">
|
||||||
|
<Link>x86\%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x64\native\*">
|
||||||
|
<Link>x64\%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'x86'">
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x86\lib\netstandard\*">
|
||||||
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x86\native\*">
|
||||||
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'x64'">
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x64\lib\netstandard\*">
|
||||||
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win-x64\native\*">
|
||||||
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup Condition=" (Exists('packages.config') Or Exists('packages.$(MSBuildProjectName).config')) And '$(Platform)' == 'ARM'">
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win8-arm\lib\netstandard\*">
|
||||||
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
<Content Include="$(MSBuildThisFileDirectory)..\..\runtimes\win8-arm\native\*">
|
||||||
|
<Link>%(Filename)%(Extension)</Link>
|
||||||
|
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||||
|
<Visible>False</Visible>
|
||||||
|
</Content>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
0
csharp/nuget/_._
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup>
|
||||||
|
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
|
||||||
|
<HasSharedItems>true</HasSharedItems>
|
||||||
|
<SharedGUID>4edc82d9-a201-4831-8fe0-98f468f8e4ae</SharedGUID>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Label="Configuration">
|
||||||
|
<Import_RootNamespace>Facebook.Yoga.Shared.Tests</Import_RootNamespace>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGAbsolutePositionTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGAlignContentTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGAlignItemsTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGAlignSelfTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGBorderTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGFlexDirectionTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGFlexTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGFlexWrapTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGJustifyContentTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGMarginTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGMinMaxDimensionTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGPaddingTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YGRoundingTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaNodeCreateTest.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)YogaNodeTest.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
13
csharp/tests/Facebook.Yoga/Facebook.Yoga.Shared.Tests.shproj
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>4edc82d9-a201-4831-8fe0-98f468f8e4ae</ProjectGuid>
|
||||||
|
<MinimumVisualStudioVersion>14.0</MinimumVisualStudioVersion>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.Default.props" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.Common.props" />
|
||||||
|
<PropertyGroup />
|
||||||
|
<Import Project="Facebook.Yoga.Shared.Tests.projitems" Label="Shared" />
|
||||||
|
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\CodeSharing\Microsoft.CodeSharing.CSharp.targets" />
|
||||||
|
</Project>
|
@@ -21,15 +21,15 @@ namespace Facebook.Yoga
|
|||||||
public void Test_absolute_layout_width_height_start_top()
|
public void Test_absolute_layout_width_height_start_top()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.PositionType = YogaPositionType.Absolute;
|
root_child0.PositionType = YogaPositionType.Absolute;
|
||||||
root_child0.SetPosition(YogaEdge.Start, 10f);
|
root_child0.SetPosition(YogaEdge.Start, 10);
|
||||||
root_child0.SetPosition(YogaEdge.Top, 10f);
|
root_child0.SetPosition(YogaEdge.Top, 10);
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -62,15 +62,15 @@ namespace Facebook.Yoga
|
|||||||
public void Test_absolute_layout_width_height_end_bottom()
|
public void Test_absolute_layout_width_height_end_bottom()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.PositionType = YogaPositionType.Absolute;
|
root_child0.PositionType = YogaPositionType.Absolute;
|
||||||
root_child0.SetPosition(YogaEdge.End, 10f);
|
root_child0.SetPosition(YogaEdge.End, 10);
|
||||||
root_child0.SetPosition(YogaEdge.Bottom, 10f);
|
root_child0.SetPosition(YogaEdge.Bottom, 10);
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -103,15 +103,15 @@ namespace Facebook.Yoga
|
|||||||
public void Test_absolute_layout_start_top_end_bottom()
|
public void Test_absolute_layout_start_top_end_bottom()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.PositionType = YogaPositionType.Absolute;
|
root_child0.PositionType = YogaPositionType.Absolute;
|
||||||
root_child0.SetPosition(YogaEdge.Start, 10f);
|
root_child0.SetPosition(YogaEdge.Start, 10);
|
||||||
root_child0.SetPosition(YogaEdge.Top, 10f);
|
root_child0.SetPosition(YogaEdge.Top, 10);
|
||||||
root_child0.SetPosition(YogaEdge.End, 10f);
|
root_child0.SetPosition(YogaEdge.End, 10);
|
||||||
root_child0.SetPosition(YogaEdge.Bottom, 10f);
|
root_child0.SetPosition(YogaEdge.Bottom, 10);
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -144,17 +144,17 @@ namespace Facebook.Yoga
|
|||||||
public void Test_absolute_layout_width_height_start_top_end_bottom()
|
public void Test_absolute_layout_width_height_start_top_end_bottom()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.PositionType = YogaPositionType.Absolute;
|
root_child0.PositionType = YogaPositionType.Absolute;
|
||||||
root_child0.SetPosition(YogaEdge.Start, 10f);
|
root_child0.SetPosition(YogaEdge.Start, 10);
|
||||||
root_child0.SetPosition(YogaEdge.Top, 10f);
|
root_child0.SetPosition(YogaEdge.Top, 10);
|
||||||
root_child0.SetPosition(YogaEdge.End, 10f);
|
root_child0.SetPosition(YogaEdge.End, 10);
|
||||||
root_child0.SetPosition(YogaEdge.Bottom, 10f);
|
root_child0.SetPosition(YogaEdge.Bottom, 10);
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -189,18 +189,18 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Overflow = YogaOverflow.Hidden;
|
root.Overflow = YogaOverflow.Hidden;
|
||||||
root.Width = 50f;
|
root.Width = 50;
|
||||||
root.Height = 50f;
|
root.Height = 50;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.PositionType = YogaPositionType.Absolute;
|
root_child0.PositionType = YogaPositionType.Absolute;
|
||||||
root_child0.SetPosition(YogaEdge.Start, 0f);
|
root_child0.SetPosition(YogaEdge.Start, 0);
|
||||||
root_child0.SetPosition(YogaEdge.Top, 0f);
|
root_child0.SetPosition(YogaEdge.Top, 0);
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child0_child0 = new YogaNode();
|
YogaNode root_child0_child0 = new YogaNode();
|
||||||
root_child0_child0.Width = 100f;
|
root_child0_child0.Width = 100;
|
||||||
root_child0_child0.Height = 100f;
|
root_child0_child0.Height = 100;
|
||||||
root_child0.Insert(0, root_child0_child0);
|
root_child0.Insert(0, root_child0_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -243,35 +243,35 @@ namespace Facebook.Yoga
|
|||||||
public void Test_absolute_layout_within_border()
|
public void Test_absolute_layout_within_border()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetMargin(YogaEdge.Left, 10f);
|
root.SetMargin(YogaEdge.Left, 10);
|
||||||
root.SetMargin(YogaEdge.Top, 10f);
|
root.SetMargin(YogaEdge.Top, 10);
|
||||||
root.SetMargin(YogaEdge.Right, 10f);
|
root.SetMargin(YogaEdge.Right, 10);
|
||||||
root.SetMargin(YogaEdge.Bottom, 10f);
|
root.SetMargin(YogaEdge.Bottom, 10);
|
||||||
root.SetPadding(YogaEdge.Left, 10f);
|
root.SetPadding(YogaEdge.Left, 10);
|
||||||
root.SetPadding(YogaEdge.Top, 10f);
|
root.SetPadding(YogaEdge.Top, 10);
|
||||||
root.SetPadding(YogaEdge.Right, 10f);
|
root.SetPadding(YogaEdge.Right, 10);
|
||||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
root.SetPadding(YogaEdge.Bottom, 10);
|
||||||
root.SetBorder(YogaEdge.Left, 10f);
|
root.SetBorder(YogaEdge.Left, 10);
|
||||||
root.SetBorder(YogaEdge.Top, 10f);
|
root.SetBorder(YogaEdge.Top, 10);
|
||||||
root.SetBorder(YogaEdge.Right, 10f);
|
root.SetBorder(YogaEdge.Right, 10);
|
||||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
root.SetBorder(YogaEdge.Bottom, 10);
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.PositionType = YogaPositionType.Absolute;
|
root_child0.PositionType = YogaPositionType.Absolute;
|
||||||
root_child0.SetPosition(YogaEdge.Left, 0f);
|
root_child0.SetPosition(YogaEdge.Left, 0);
|
||||||
root_child0.SetPosition(YogaEdge.Top, 0f);
|
root_child0.SetPosition(YogaEdge.Top, 0);
|
||||||
root_child0.Width = 50f;
|
root_child0.Width = 50;
|
||||||
root_child0.Height = 50f;
|
root_child0.Height = 50;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.PositionType = YogaPositionType.Absolute;
|
root_child1.PositionType = YogaPositionType.Absolute;
|
||||||
root_child1.SetPosition(YogaEdge.Right, 0f);
|
root_child1.SetPosition(YogaEdge.Right, 0);
|
||||||
root_child1.SetPosition(YogaEdge.Bottom, 0f);
|
root_child1.SetPosition(YogaEdge.Bottom, 0);
|
||||||
root_child1.Width = 50f;
|
root_child1.Width = 50;
|
||||||
root_child1.Height = 50f;
|
root_child1.Height = 50;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
@@ -22,32 +22,32 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Wrap = YogaWrap.Wrap;
|
root.Wrap = YogaWrap.Wrap;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 50f;
|
root_child0.Width = 50;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 50f;
|
root_child1.Width = 50;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 50f;
|
root_child2.Width = 50;
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
|
|
||||||
YogaNode root_child3 = new YogaNode();
|
YogaNode root_child3 = new YogaNode();
|
||||||
root_child3.Width = 50f;
|
root_child3.Width = 50;
|
||||||
root_child3.Height = 10f;
|
root_child3.Height = 10;
|
||||||
root.Insert(3, root_child3);
|
root.Insert(3, root_child3);
|
||||||
|
|
||||||
YogaNode root_child4 = new YogaNode();
|
YogaNode root_child4 = new YogaNode();
|
||||||
root_child4.Width = 50f;
|
root_child4.Width = 50;
|
||||||
root_child4.Height = 10f;
|
root_child4.Height = 10;
|
||||||
root.Insert(4, root_child4);
|
root.Insert(4, root_child4);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -122,32 +122,32 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.AlignContent = YogaAlign.FlexEnd;
|
root.AlignContent = YogaAlign.FlexEnd;
|
||||||
root.Wrap = YogaWrap.Wrap;
|
root.Wrap = YogaWrap.Wrap;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 50f;
|
root_child0.Width = 50;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 50f;
|
root_child1.Width = 50;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 50f;
|
root_child2.Width = 50;
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
|
|
||||||
YogaNode root_child3 = new YogaNode();
|
YogaNode root_child3 = new YogaNode();
|
||||||
root_child3.Width = 50f;
|
root_child3.Width = 50;
|
||||||
root_child3.Height = 10f;
|
root_child3.Height = 10;
|
||||||
root.Insert(3, root_child3);
|
root.Insert(3, root_child3);
|
||||||
|
|
||||||
YogaNode root_child4 = new YogaNode();
|
YogaNode root_child4 = new YogaNode();
|
||||||
root_child4.Width = 50f;
|
root_child4.Width = 50;
|
||||||
root_child4.Height = 10f;
|
root_child4.Height = 10;
|
||||||
root.Insert(4, root_child4);
|
root.Insert(4, root_child4);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -222,32 +222,32 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.AlignContent = YogaAlign.Center;
|
root.AlignContent = YogaAlign.Center;
|
||||||
root.Wrap = YogaWrap.Wrap;
|
root.Wrap = YogaWrap.Wrap;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 50f;
|
root_child0.Width = 50;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 50f;
|
root_child1.Width = 50;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 50f;
|
root_child2.Width = 50;
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
|
|
||||||
YogaNode root_child3 = new YogaNode();
|
YogaNode root_child3 = new YogaNode();
|
||||||
root_child3.Width = 50f;
|
root_child3.Width = 50;
|
||||||
root_child3.Height = 10f;
|
root_child3.Height = 10;
|
||||||
root.Insert(3, root_child3);
|
root.Insert(3, root_child3);
|
||||||
|
|
||||||
YogaNode root_child4 = new YogaNode();
|
YogaNode root_child4 = new YogaNode();
|
||||||
root_child4.Width = 50f;
|
root_child4.Width = 50;
|
||||||
root_child4.Height = 10f;
|
root_child4.Height = 10;
|
||||||
root.Insert(4, root_child4);
|
root.Insert(4, root_child4);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -322,27 +322,27 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.AlignContent = YogaAlign.Stretch;
|
root.AlignContent = YogaAlign.Stretch;
|
||||||
root.Wrap = YogaWrap.Wrap;
|
root.Wrap = YogaWrap.Wrap;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 50f;
|
root_child0.Width = 50;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 50f;
|
root_child1.Width = 50;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 50f;
|
root_child2.Width = 50;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
|
|
||||||
YogaNode root_child3 = new YogaNode();
|
YogaNode root_child3 = new YogaNode();
|
||||||
root_child3.Width = 50f;
|
root_child3.Width = 50;
|
||||||
root.Insert(3, root_child3);
|
root.Insert(3, root_child3);
|
||||||
|
|
||||||
YogaNode root_child4 = new YogaNode();
|
YogaNode root_child4 = new YogaNode();
|
||||||
root_child4.Width = 50f;
|
root_child4.Width = 50;
|
||||||
root.Insert(4, root_child4);
|
root.Insert(4, root_child4);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
@@ -21,13 +21,13 @@ namespace Facebook.Yoga
|
|||||||
public void Test_align_self_center()
|
public void Test_align_self_center()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.AlignSelf = YogaAlign.Center;
|
root_child0.AlignSelf = YogaAlign.Center;
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -60,13 +60,13 @@ namespace Facebook.Yoga
|
|||||||
public void Test_align_self_flex_end()
|
public void Test_align_self_flex_end()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.AlignSelf = YogaAlign.FlexEnd;
|
root_child0.AlignSelf = YogaAlign.FlexEnd;
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -99,13 +99,13 @@ namespace Facebook.Yoga
|
|||||||
public void Test_align_self_flex_start()
|
public void Test_align_self_flex_start()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.AlignSelf = YogaAlign.FlexStart;
|
root_child0.AlignSelf = YogaAlign.FlexStart;
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -139,13 +139,13 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.AlignItems = YogaAlign.FlexStart;
|
root.AlignItems = YogaAlign.FlexStart;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.AlignSelf = YogaAlign.FlexEnd;
|
root_child0.AlignSelf = YogaAlign.FlexEnd;
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -174,5 +174,76 @@ namespace Facebook.Yoga
|
|||||||
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_align_self_baseline()
|
||||||
|
{
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.Width = 100;
|
||||||
|
root.Height = 100;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.AlignSelf = YogaAlign.Baseline;
|
||||||
|
root_child0.Width = 50;
|
||||||
|
root_child0.Height = 50;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.AlignSelf = YogaAlign.Baseline;
|
||||||
|
root_child1.Width = 50;
|
||||||
|
root_child1.Height = 20;
|
||||||
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
|
YogaNode root_child1_child0 = new YogaNode();
|
||||||
|
root_child1_child0.Width = 50;
|
||||||
|
root_child1_child0.Height = 10;
|
||||||
|
root_child1.Insert(0, root_child1_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(100f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(40f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1_child0.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child1_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child1_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(100f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(40f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(20f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1_child0.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child1_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child1_child0.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,10 +21,10 @@ namespace Facebook.Yoga
|
|||||||
public void Test_border_no_size()
|
public void Test_border_no_size()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetBorder(YogaEdge.Left, 10f);
|
root.SetBorder(YogaEdge.Left, 10);
|
||||||
root.SetBorder(YogaEdge.Top, 10f);
|
root.SetBorder(YogaEdge.Top, 10);
|
||||||
root.SetBorder(YogaEdge.Right, 10f);
|
root.SetBorder(YogaEdge.Right, 10);
|
||||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
root.SetBorder(YogaEdge.Bottom, 10);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
|
||||||
@@ -46,14 +46,14 @@ namespace Facebook.Yoga
|
|||||||
public void Test_border_container_match_child()
|
public void Test_border_container_match_child()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetBorder(YogaEdge.Left, 10f);
|
root.SetBorder(YogaEdge.Left, 10);
|
||||||
root.SetBorder(YogaEdge.Top, 10f);
|
root.SetBorder(YogaEdge.Top, 10);
|
||||||
root.SetBorder(YogaEdge.Right, 10f);
|
root.SetBorder(YogaEdge.Right, 10);
|
||||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
root.SetBorder(YogaEdge.Bottom, 10);
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -86,16 +86,16 @@ namespace Facebook.Yoga
|
|||||||
public void Test_border_flex_child()
|
public void Test_border_flex_child()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetBorder(YogaEdge.Left, 10f);
|
root.SetBorder(YogaEdge.Left, 10);
|
||||||
root.SetBorder(YogaEdge.Top, 10f);
|
root.SetBorder(YogaEdge.Top, 10);
|
||||||
root.SetBorder(YogaEdge.Right, 10f);
|
root.SetBorder(YogaEdge.Right, 10);
|
||||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
root.SetBorder(YogaEdge.Bottom, 10);
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -128,15 +128,15 @@ namespace Facebook.Yoga
|
|||||||
public void Test_border_stretch_child()
|
public void Test_border_stretch_child()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetBorder(YogaEdge.Left, 10f);
|
root.SetBorder(YogaEdge.Left, 10);
|
||||||
root.SetBorder(YogaEdge.Top, 10f);
|
root.SetBorder(YogaEdge.Top, 10);
|
||||||
root.SetBorder(YogaEdge.Right, 10f);
|
root.SetBorder(YogaEdge.Right, 10);
|
||||||
root.SetBorder(YogaEdge.Bottom, 10f);
|
root.SetBorder(YogaEdge.Bottom, 10);
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -171,15 +171,15 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.JustifyContent = YogaJustify.Center;
|
root.JustifyContent = YogaJustify.Center;
|
||||||
root.AlignItems = YogaAlign.Center;
|
root.AlignItems = YogaAlign.Center;
|
||||||
root.SetBorder(YogaEdge.Start, 10f);
|
root.SetBorder(YogaEdge.Start, 10);
|
||||||
root.SetBorder(YogaEdge.End, 20f);
|
root.SetBorder(YogaEdge.End, 20);
|
||||||
root.SetBorder(YogaEdge.Bottom, 20f);
|
root.SetBorder(YogaEdge.Bottom, 20);
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
@@ -21,18 +21,18 @@ namespace Facebook.Yoga
|
|||||||
public void Test_flex_direction_column_no_height()
|
public void Test_flex_direction_column_no_height()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -86,18 +86,18 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 10f;
|
root_child1.Width = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 10f;
|
root_child2.Width = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -150,19 +150,19 @@ namespace Facebook.Yoga
|
|||||||
public void Test_flex_direction_column()
|
public void Test_flex_direction_column()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -216,19 +216,19 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 10f;
|
root_child1.Width = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 10f;
|
root_child2.Width = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -282,19 +282,19 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.ColumnReverse;
|
root.FlexDirection = YogaFlexDirection.ColumnReverse;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -348,19 +348,19 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.RowReverse;
|
root.FlexDirection = YogaFlexDirection.RowReverse;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 10f;
|
root_child1.Width = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 10f;
|
root_child2.Width = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
@@ -21,16 +21,16 @@ namespace Facebook.Yoga
|
|||||||
public void Test_flex_basis_flex_grow_column()
|
public void Test_flex_basis_flex_grow_column()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.FlexBasis = 50f;
|
root_child0.FlexBasis = 50;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -74,16 +74,16 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.FlexBasis = 50f;
|
root_child0.FlexBasis = 50;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -126,16 +126,16 @@ namespace Facebook.Yoga
|
|||||||
public void Test_flex_basis_flex_shrink_column()
|
public void Test_flex_basis_flex_shrink_column()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexShrink = 1f;
|
root_child0.FlexShrink = 1;
|
||||||
root_child0.FlexBasis = 100f;
|
root_child0.FlexBasis = 100;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexBasis = 50f;
|
root_child1.FlexBasis = 50;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -179,16 +179,16 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexShrink = 1f;
|
root_child0.FlexShrink = 1;
|
||||||
root_child0.FlexBasis = 100f;
|
root_child0.FlexBasis = 100;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexBasis = 50f;
|
root_child1.FlexBasis = 50;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -231,22 +231,22 @@ namespace Facebook.Yoga
|
|||||||
public void Test_flex_shrink_to_zero()
|
public void Test_flex_shrink_to_zero()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Height = 75f;
|
root.Height = 75;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 50f;
|
root_child0.Width = 50;
|
||||||
root_child0.Height = 50f;
|
root_child0.Height = 50;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexShrink = 1f;
|
root_child1.FlexShrink = 1;
|
||||||
root_child1.Width = 50f;
|
root_child1.Width = 50;
|
||||||
root_child1.Height = 50f;
|
root_child1.Height = 50;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 50f;
|
root_child2.Width = 50;
|
||||||
root_child2.Height = 50f;
|
root_child2.Height = 50;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -299,23 +299,23 @@ namespace Facebook.Yoga
|
|||||||
public void Test_flex_basis_overrides_main_size()
|
public void Test_flex_basis_overrides_main_size()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.FlexBasis = 50f;
|
root_child0.FlexBasis = 50;
|
||||||
root_child0.Height = 20f;
|
root_child0.Height = 20;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.FlexGrow = 1f;
|
root_child2.FlexGrow = 1;
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -368,15 +368,15 @@ namespace Facebook.Yoga
|
|||||||
public void Test_flex_grow_shrink_at_most()
|
public void Test_flex_grow_shrink_at_most()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child0_child0 = new YogaNode();
|
YogaNode root_child0_child0 = new YogaNode();
|
||||||
root_child0_child0.FlexGrow = 1f;
|
root_child0_child0.FlexGrow = 1;
|
||||||
root_child0_child0.FlexShrink = 1f;
|
root_child0_child0.FlexShrink = 1;
|
||||||
root_child0.Insert(0, root_child0_child0);
|
root_child0.Insert(0, root_child0_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
@@ -22,26 +22,26 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Wrap = YogaWrap.Wrap;
|
root.Wrap = YogaWrap.Wrap;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 30f;
|
root_child0.Width = 30;
|
||||||
root_child0.Height = 30f;
|
root_child0.Height = 30;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 30f;
|
root_child1.Width = 30;
|
||||||
root_child1.Height = 30f;
|
root_child1.Height = 30;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 30f;
|
root_child2.Width = 30;
|
||||||
root_child2.Height = 30f;
|
root_child2.Height = 30;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
|
|
||||||
YogaNode root_child3 = new YogaNode();
|
YogaNode root_child3 = new YogaNode();
|
||||||
root_child3.Width = 30f;
|
root_child3.Width = 30;
|
||||||
root_child3.Height = 30f;
|
root_child3.Height = 30;
|
||||||
root.Insert(3, root_child3);
|
root.Insert(3, root_child3);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -106,26 +106,26 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Wrap = YogaWrap.Wrap;
|
root.Wrap = YogaWrap.Wrap;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 30f;
|
root_child0.Width = 30;
|
||||||
root_child0.Height = 30f;
|
root_child0.Height = 30;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 30f;
|
root_child1.Width = 30;
|
||||||
root_child1.Height = 30f;
|
root_child1.Height = 30;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 30f;
|
root_child2.Width = 30;
|
||||||
root_child2.Height = 30f;
|
root_child2.Height = 30;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
|
|
||||||
YogaNode root_child3 = new YogaNode();
|
YogaNode root_child3 = new YogaNode();
|
||||||
root_child3.Width = 30f;
|
root_child3.Width = 30;
|
||||||
root_child3.Height = 30f;
|
root_child3.Height = 30;
|
||||||
root.Insert(3, root_child3);
|
root.Insert(3, root_child3);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -191,26 +191,26 @@ namespace Facebook.Yoga
|
|||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.AlignItems = YogaAlign.FlexEnd;
|
root.AlignItems = YogaAlign.FlexEnd;
|
||||||
root.Wrap = YogaWrap.Wrap;
|
root.Wrap = YogaWrap.Wrap;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 30f;
|
root_child0.Width = 30;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 30f;
|
root_child1.Width = 30;
|
||||||
root_child1.Height = 20f;
|
root_child1.Height = 20;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 30f;
|
root_child2.Width = 30;
|
||||||
root_child2.Height = 30f;
|
root_child2.Height = 30;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
|
|
||||||
YogaNode root_child3 = new YogaNode();
|
YogaNode root_child3 = new YogaNode();
|
||||||
root_child3.Width = 30f;
|
root_child3.Width = 30;
|
||||||
root_child3.Height = 30f;
|
root_child3.Height = 30;
|
||||||
root.Insert(3, root_child3);
|
root.Insert(3, root_child3);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -276,26 +276,26 @@ namespace Facebook.Yoga
|
|||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.AlignItems = YogaAlign.Center;
|
root.AlignItems = YogaAlign.Center;
|
||||||
root.Wrap = YogaWrap.Wrap;
|
root.Wrap = YogaWrap.Wrap;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 30f;
|
root_child0.Width = 30;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 30f;
|
root_child1.Width = 30;
|
||||||
root_child1.Height = 20f;
|
root_child1.Height = 20;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 30f;
|
root_child2.Width = 30;
|
||||||
root_child2.Height = 30f;
|
root_child2.Height = 30;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
|
|
||||||
YogaNode root_child3 = new YogaNode();
|
YogaNode root_child3 = new YogaNode();
|
||||||
root_child3.Width = 30f;
|
root_child3.Width = 30;
|
||||||
root_child3.Height = 30f;
|
root_child3.Height = 30;
|
||||||
root.Insert(3, root_child3);
|
root.Insert(3, root_child3);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
@@ -22,19 +22,19 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 102f;
|
root.Width = 102;
|
||||||
root.Height = 102f;
|
root.Height = 102;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 10f;
|
root_child1.Width = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 10f;
|
root_child2.Width = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -89,19 +89,19 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.JustifyContent = YogaJustify.FlexEnd;
|
root.JustifyContent = YogaJustify.FlexEnd;
|
||||||
root.Width = 102f;
|
root.Width = 102;
|
||||||
root.Height = 102f;
|
root.Height = 102;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 10f;
|
root_child1.Width = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 10f;
|
root_child2.Width = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -156,19 +156,19 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.JustifyContent = YogaJustify.Center;
|
root.JustifyContent = YogaJustify.Center;
|
||||||
root.Width = 102f;
|
root.Width = 102;
|
||||||
root.Height = 102f;
|
root.Height = 102;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 10f;
|
root_child1.Width = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 10f;
|
root_child2.Width = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -223,19 +223,19 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.JustifyContent = YogaJustify.SpaceBetween;
|
root.JustifyContent = YogaJustify.SpaceBetween;
|
||||||
root.Width = 102f;
|
root.Width = 102;
|
||||||
root.Height = 102f;
|
root.Height = 102;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 10f;
|
root_child1.Width = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 10f;
|
root_child2.Width = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -290,19 +290,19 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.JustifyContent = YogaJustify.SpaceAround;
|
root.JustifyContent = YogaJustify.SpaceAround;
|
||||||
root.Width = 102f;
|
root.Width = 102;
|
||||||
root.Height = 102f;
|
root.Height = 102;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 10f;
|
root_child1.Width = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 10f;
|
root_child2.Width = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -355,18 +355,18 @@ namespace Facebook.Yoga
|
|||||||
public void Test_justify_content_column_flex_start()
|
public void Test_justify_content_column_flex_start()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 102f;
|
root.Width = 102;
|
||||||
root.Height = 102f;
|
root.Height = 102;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -420,19 +420,19 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.JustifyContent = YogaJustify.FlexEnd;
|
root.JustifyContent = YogaJustify.FlexEnd;
|
||||||
root.Width = 102f;
|
root.Width = 102;
|
||||||
root.Height = 102f;
|
root.Height = 102;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -486,19 +486,19 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.JustifyContent = YogaJustify.Center;
|
root.JustifyContent = YogaJustify.Center;
|
||||||
root.Width = 102f;
|
root.Width = 102;
|
||||||
root.Height = 102f;
|
root.Height = 102;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -552,19 +552,19 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.JustifyContent = YogaJustify.SpaceBetween;
|
root.JustifyContent = YogaJustify.SpaceBetween;
|
||||||
root.Width = 102f;
|
root.Width = 102;
|
||||||
root.Height = 102f;
|
root.Height = 102;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -618,19 +618,19 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.JustifyContent = YogaJustify.SpaceAround;
|
root.JustifyContent = YogaJustify.SpaceAround;
|
||||||
root.Width = 102f;
|
root.Width = 102;
|
||||||
root.Height = 102f;
|
root.Height = 102;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
@@ -22,12 +22,12 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.SetMargin(YogaEdge.Start, 10f);
|
root_child0.SetMargin(YogaEdge.Start, 10);
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -60,12 +60,12 @@ namespace Facebook.Yoga
|
|||||||
public void Test_margin_top()
|
public void Test_margin_top()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.SetMargin(YogaEdge.Top, 10f);
|
root_child0.SetMargin(YogaEdge.Top, 10);
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -100,12 +100,12 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.JustifyContent = YogaJustify.FlexEnd;
|
root.JustifyContent = YogaJustify.FlexEnd;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.SetMargin(YogaEdge.End, 10f);
|
root_child0.SetMargin(YogaEdge.End, 10);
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -139,12 +139,12 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.JustifyContent = YogaJustify.FlexEnd;
|
root.JustifyContent = YogaJustify.FlexEnd;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.SetMargin(YogaEdge.Bottom, 10f);
|
root_child0.SetMargin(YogaEdge.Bottom, 10);
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -178,12 +178,12 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.SetMargin(YogaEdge.Start, 10f);
|
root_child0.SetMargin(YogaEdge.Start, 10);
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -216,12 +216,12 @@ namespace Facebook.Yoga
|
|||||||
public void Test_margin_and_flex_column()
|
public void Test_margin_and_flex_column()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.SetMargin(YogaEdge.Top, 10f);
|
root_child0.SetMargin(YogaEdge.Top, 10);
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -255,12 +255,12 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.SetMargin(YogaEdge.Top, 10f);
|
root_child0.SetMargin(YogaEdge.Top, 10);
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -293,12 +293,12 @@ namespace Facebook.Yoga
|
|||||||
public void Test_margin_and_stretch_column()
|
public void Test_margin_and_stretch_column()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.SetMargin(YogaEdge.Start, 10f);
|
root_child0.SetMargin(YogaEdge.Start, 10);
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -332,15 +332,15 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -383,15 +383,15 @@ namespace Facebook.Yoga
|
|||||||
public void Test_margin_with_sibling_column()
|
public void Test_margin_with_sibling_column()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
@@ -21,12 +21,12 @@ namespace Facebook.Yoga
|
|||||||
public void Test_max_width()
|
public void Test_max_width()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.MaxWidth = 50f;
|
root_child0.MaxWidth = 50;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -60,12 +60,12 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.MaxHeight = 50f;
|
root_child0.MaxHeight = 50;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -98,16 +98,16 @@ namespace Facebook.Yoga
|
|||||||
public void Test_min_height()
|
public void Test_min_height()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.MinHeight = 60f;
|
root_child0.MinHeight = 60;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -151,16 +151,16 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.MinWidth = 60f;
|
root_child0.MinWidth = 60;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -204,13 +204,13 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.JustifyContent = YogaJustify.Center;
|
root.JustifyContent = YogaJustify.Center;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.MinHeight = 100f;
|
root.MinHeight = 100;
|
||||||
root.MaxHeight = 200f;
|
root.MaxHeight = 200;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 60f;
|
root_child0.Width = 60;
|
||||||
root_child0.Height = 60f;
|
root_child0.Height = 60;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -244,13 +244,13 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.AlignItems = YogaAlign.Center;
|
root.AlignItems = YogaAlign.Center;
|
||||||
root.MinWidth = 100f;
|
root.MinWidth = 100;
|
||||||
root.MaxWidth = 200f;
|
root.MaxWidth = 200;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 60f;
|
root_child0.Width = 60;
|
||||||
root_child0.Height = 60f;
|
root_child0.Height = 60;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -284,22 +284,22 @@ namespace Facebook.Yoga
|
|||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.JustifyContent = YogaJustify.Center;
|
root.JustifyContent = YogaJustify.Center;
|
||||||
root.MinHeight = 100f;
|
root.MinHeight = 100;
|
||||||
root.MaxHeight = 110f;
|
root.MaxHeight = 110;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 50f;
|
root_child0.Width = 50;
|
||||||
root_child0.Height = 50f;
|
root_child0.Height = 50;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.Width = 50f;
|
root_child1.Width = 50;
|
||||||
root_child1.Height = 50f;
|
root_child1.Height = 50;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.Width = 50f;
|
root_child2.Width = 50;
|
||||||
root_child2.Height = 50f;
|
root_child2.Height = 50;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -352,17 +352,17 @@ namespace Facebook.Yoga
|
|||||||
public void Test_flex_grow_within_max_width()
|
public void Test_flex_grow_within_max_width()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 200f;
|
root.Width = 200;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexDirection = YogaFlexDirection.Row;
|
root_child0.FlexDirection = YogaFlexDirection.Row;
|
||||||
root_child0.MaxWidth = 100f;
|
root_child0.MaxWidth = 100;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child0_child0 = new YogaNode();
|
YogaNode root_child0_child0 = new YogaNode();
|
||||||
root_child0_child0.FlexGrow = 1f;
|
root_child0_child0.FlexGrow = 1;
|
||||||
root_child0_child0.Height = 20f;
|
root_child0_child0.Height = 20;
|
||||||
root_child0.Insert(0, root_child0_child0);
|
root_child0.Insert(0, root_child0_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -405,17 +405,17 @@ namespace Facebook.Yoga
|
|||||||
public void Test_flex_grow_within_constrained_max_width()
|
public void Test_flex_grow_within_constrained_max_width()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 200f;
|
root.Width = 200;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexDirection = YogaFlexDirection.Row;
|
root_child0.FlexDirection = YogaFlexDirection.Row;
|
||||||
root_child0.MaxWidth = 300f;
|
root_child0.MaxWidth = 300;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child0_child0 = new YogaNode();
|
YogaNode root_child0_child0 = new YogaNode();
|
||||||
root_child0_child0.FlexGrow = 1f;
|
root_child0_child0.FlexGrow = 1;
|
||||||
root_child0_child0.Height = 20f;
|
root_child0_child0.Height = 20;
|
||||||
root_child0.Insert(0, root_child0_child0);
|
root_child0.Insert(0, root_child0_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -454,5 +454,226 @@ namespace Facebook.Yoga
|
|||||||
Assert.AreEqual(20f, root_child0_child0.LayoutHeight);
|
Assert.AreEqual(20f, root_child0_child0.LayoutHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_flex_grow_within_constrained_min_row()
|
||||||
|
{
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.MinWidth = 100;
|
||||||
|
root.Height = 100;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.Width = 50;
|
||||||
|
root.Insert(1, root_child1);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(100f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(100f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child1.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_flex_grow_within_constrained_min_column()
|
||||||
|
{
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.MinHeight = 100;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
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(0f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(0f, 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(0f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_flex_grow_within_constrained_max_row()
|
||||||
|
{
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root_child0.MaxWidth = 100;
|
||||||
|
root_child0.Height = 100;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0 = new YogaNode();
|
||||||
|
root_child0_child0.FlexShrink = 1;
|
||||||
|
root_child0_child0.FlexBasis = 100;
|
||||||
|
root_child0.Insert(0, root_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child1 = new YogaNode();
|
||||||
|
root_child0_child1.Width = 50;
|
||||||
|
root_child0.Insert(1, root_child0_child1);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(50f, root_child0_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child1.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child0_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child0_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(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(50f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child1.LayoutY);
|
||||||
|
Assert.AreEqual(50f, root_child0_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child0_child1.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_flex_grow_within_constrained_max_column()
|
||||||
|
{
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 100;
|
||||||
|
root.MaxHeight = 100;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexShrink = 1;
|
||||||
|
root_child0.FlexBasis = 100;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
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(100f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(100f, 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(100f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(100f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutHeight);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -21,10 +21,10 @@ namespace Facebook.Yoga
|
|||||||
public void Test_padding_no_size()
|
public void Test_padding_no_size()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetPadding(YogaEdge.Left, 10f);
|
root.SetPadding(YogaEdge.Left, 10);
|
||||||
root.SetPadding(YogaEdge.Top, 10f);
|
root.SetPadding(YogaEdge.Top, 10);
|
||||||
root.SetPadding(YogaEdge.Right, 10f);
|
root.SetPadding(YogaEdge.Right, 10);
|
||||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
root.SetPadding(YogaEdge.Bottom, 10);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
|
||||||
@@ -46,14 +46,14 @@ namespace Facebook.Yoga
|
|||||||
public void Test_padding_container_match_child()
|
public void Test_padding_container_match_child()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetPadding(YogaEdge.Left, 10f);
|
root.SetPadding(YogaEdge.Left, 10);
|
||||||
root.SetPadding(YogaEdge.Top, 10f);
|
root.SetPadding(YogaEdge.Top, 10);
|
||||||
root.SetPadding(YogaEdge.Right, 10f);
|
root.SetPadding(YogaEdge.Right, 10);
|
||||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
root.SetPadding(YogaEdge.Bottom, 10);
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -86,16 +86,16 @@ namespace Facebook.Yoga
|
|||||||
public void Test_padding_flex_child()
|
public void Test_padding_flex_child()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetPadding(YogaEdge.Left, 10f);
|
root.SetPadding(YogaEdge.Left, 10);
|
||||||
root.SetPadding(YogaEdge.Top, 10f);
|
root.SetPadding(YogaEdge.Top, 10);
|
||||||
root.SetPadding(YogaEdge.Right, 10f);
|
root.SetPadding(YogaEdge.Right, 10);
|
||||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
root.SetPadding(YogaEdge.Bottom, 10);
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -128,15 +128,15 @@ namespace Facebook.Yoga
|
|||||||
public void Test_padding_stretch_child()
|
public void Test_padding_stretch_child()
|
||||||
{
|
{
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetPadding(YogaEdge.Left, 10f);
|
root.SetPadding(YogaEdge.Left, 10);
|
||||||
root.SetPadding(YogaEdge.Top, 10f);
|
root.SetPadding(YogaEdge.Top, 10);
|
||||||
root.SetPadding(YogaEdge.Right, 10f);
|
root.SetPadding(YogaEdge.Right, 10);
|
||||||
root.SetPadding(YogaEdge.Bottom, 10f);
|
root.SetPadding(YogaEdge.Bottom, 10);
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -171,15 +171,15 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.JustifyContent = YogaJustify.Center;
|
root.JustifyContent = YogaJustify.Center;
|
||||||
root.AlignItems = YogaAlign.Center;
|
root.AlignItems = YogaAlign.Center;
|
||||||
root.SetPadding(YogaEdge.Start, 10f);
|
root.SetPadding(YogaEdge.Start, 10);
|
||||||
root.SetPadding(YogaEdge.End, 20f);
|
root.SetPadding(YogaEdge.End, 20);
|
||||||
root.SetPadding(YogaEdge.Bottom, 20f);
|
root.SetPadding(YogaEdge.Bottom, 20);
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.Width = 10f;
|
root_child0.Width = 10;
|
||||||
root_child0.Height = 10f;
|
root_child0.Height = 10;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -214,16 +214,16 @@ namespace Facebook.Yoga
|
|||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.JustifyContent = YogaJustify.FlexEnd;
|
root.JustifyContent = YogaJustify.FlexEnd;
|
||||||
root.AlignItems = YogaAlign.FlexEnd;
|
root.AlignItems = YogaAlign.FlexEnd;
|
||||||
root.Width = 200f;
|
root.Width = 200;
|
||||||
root.Height = 200f;
|
root.Height = 200;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.SetPadding(YogaEdge.Left, 20f);
|
root_child0.SetPadding(YogaEdge.Left, 20);
|
||||||
root_child0.SetPadding(YogaEdge.Top, 20f);
|
root_child0.SetPadding(YogaEdge.Top, 20);
|
||||||
root_child0.SetPadding(YogaEdge.Right, 20f);
|
root_child0.SetPadding(YogaEdge.Right, 20);
|
||||||
root_child0.SetPadding(YogaEdge.Bottom, 20f);
|
root_child0.SetPadding(YogaEdge.Bottom, 20);
|
||||||
root_child0.Width = 100f;
|
root_child0.Width = 100;
|
||||||
root_child0.Height = 100f;
|
root_child0.Height = 100;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
959
csharp/tests/Facebook.Yoga/YGPercentageTest.cs
Normal file
@@ -0,0 +1,959 @@
|
|||||||
|
/**
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
// @Generated by gentest/gentest.rb from gentest/fixtures/YGPercentageTest.html
|
||||||
|
|
||||||
|
using System;
|
||||||
|
using NUnit.Framework;
|
||||||
|
|
||||||
|
namespace Facebook.Yoga
|
||||||
|
{
|
||||||
|
[TestFixture]
|
||||||
|
public class YGPercentageTest
|
||||||
|
{
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_width_height()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.Width = 30.Percent();
|
||||||
|
root_child0.Height = 30.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(60f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(60f, root_child0.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(140f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(60f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(60f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_position_left_top()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.Width = 400;
|
||||||
|
root.Height = 400;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.SetPosition(YogaEdge.Left, 10.Percent());
|
||||||
|
root_child0.SetPosition(YogaEdge.Top, 20.Percent());
|
||||||
|
root_child0.Width = 45.Percent();
|
||||||
|
root_child0.Height = 55.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(400f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(400f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(40f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(80f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(180f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(220f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(400f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(400f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(260f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(80f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(180f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(220f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_position_bottom_right()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.Width = 500;
|
||||||
|
root.Height = 500;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.SetPosition(YogaEdge.Right, 20.Percent());
|
||||||
|
root_child0.SetPosition(YogaEdge.Bottom, 10.Percent());
|
||||||
|
root_child0.Width = 55.Percent();
|
||||||
|
root_child0.Height = 15.Percent();
|
||||||
|
root.Insert(0, root_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(-100f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(-50f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(275f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(75f, root_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(125f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(-50f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(275f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(75f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_flex_basis()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexBasis = 50.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.FlexGrow = 1;
|
||||||
|
root_child1.FlexBasis = 25.Percent();
|
||||||
|
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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(125f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(125f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(75f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, 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(75f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(125f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(75f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_flex_basis_cross()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexBasis = 50.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.FlexGrow = 1;
|
||||||
|
root_child1.FlexBasis = 25.Percent();
|
||||||
|
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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(125f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(125f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(75f, 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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(125f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(125f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(75f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_flex_basis_cross_min_height()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.MinHeight = 60.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.FlexGrow = 2;
|
||||||
|
root_child1.MinHeight = 10.Percent();
|
||||||
|
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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(140f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(140f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(60f, 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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(140f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(140f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(60f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_flex_basis_main_max_height()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexBasis = 10.Percent();
|
||||||
|
root_child0.MaxHeight = 60.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.FlexGrow = 4;
|
||||||
|
root_child1.FlexBasis = 10.Percent();
|
||||||
|
root_child1.MaxHeight = 20.Percent();
|
||||||
|
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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(52f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(120f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(52f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(148f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(40f, 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(148f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(52f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(120f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(148f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(40f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_flex_basis_cross_max_height()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexBasis = 10.Percent();
|
||||||
|
root_child0.MaxHeight = 60.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.FlexGrow = 4;
|
||||||
|
root_child1.FlexBasis = 10.Percent();
|
||||||
|
root_child1.MaxHeight = 20.Percent();
|
||||||
|
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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(120f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(120f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(40f, 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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(120f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(120f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(40f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_flex_basis_main_max_width()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexBasis = 15.Percent();
|
||||||
|
root_child0.MaxWidth = 60.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.FlexGrow = 4;
|
||||||
|
root_child1.FlexBasis = 10.Percent();
|
||||||
|
root_child1.MaxWidth = 20.Percent();
|
||||||
|
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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(120f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(120f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(40f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, 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(80f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(120f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(40f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(40f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_flex_basis_cross_max_width()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexBasis = 10.Percent();
|
||||||
|
root_child0.MaxWidth = 60.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.FlexGrow = 4;
|
||||||
|
root_child1.FlexBasis = 15.Percent();
|
||||||
|
root_child1.MaxWidth = 20.Percent();
|
||||||
|
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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(120f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(40f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(150f, 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(80f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(120f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(160f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(40f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(150f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_flex_basis_main_min_width()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexBasis = 15.Percent();
|
||||||
|
root_child0.MinWidth = 60.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.FlexGrow = 4;
|
||||||
|
root_child1.FlexBasis = 10.Percent();
|
||||||
|
root_child1.MinWidth = 20.Percent();
|
||||||
|
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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(120f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(120f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(80f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, 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(80f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(120f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(80f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_flex_basis_cross_min_width()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexBasis = 10.Percent();
|
||||||
|
root_child0.MinWidth = 60.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.FlexGrow = 4;
|
||||||
|
root_child1.FlexBasis = 15.Percent();
|
||||||
|
root_child1.MinWidth = 20.Percent();
|
||||||
|
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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(150f, 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(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(50f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(50f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(150f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_multiple_nested_with_padding_margin_and_percentage_values()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 200;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.FlexBasis = 10.Percent();
|
||||||
|
root_child0.SetMargin(YogaEdge.Left, 5);
|
||||||
|
root_child0.SetMargin(YogaEdge.Top, 5);
|
||||||
|
root_child0.SetMargin(YogaEdge.Right, 5);
|
||||||
|
root_child0.SetMargin(YogaEdge.Bottom, 5);
|
||||||
|
root_child0.SetPadding(YogaEdge.Left, 3);
|
||||||
|
root_child0.SetPadding(YogaEdge.Top, 3);
|
||||||
|
root_child0.SetPadding(YogaEdge.Right, 3);
|
||||||
|
root_child0.SetPadding(YogaEdge.Bottom, 3);
|
||||||
|
root_child0.MinWidth = 60.Percent();
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0 = new YogaNode();
|
||||||
|
root_child0_child0.SetMargin(YogaEdge.Left, 5);
|
||||||
|
root_child0_child0.SetMargin(YogaEdge.Top, 5);
|
||||||
|
root_child0_child0.SetMargin(YogaEdge.Right, 5);
|
||||||
|
root_child0_child0.SetMargin(YogaEdge.Bottom, 5);
|
||||||
|
root_child0_child0.SetPadding(YogaEdge.Left, 3.Percent());
|
||||||
|
root_child0_child0.SetPadding(YogaEdge.Top, 3.Percent());
|
||||||
|
root_child0_child0.SetPadding(YogaEdge.Right, 3.Percent());
|
||||||
|
root_child0_child0.SetPadding(YogaEdge.Bottom, 3.Percent());
|
||||||
|
root_child0_child0.Width = 50.Percent();
|
||||||
|
root_child0.Insert(0, root_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0_child0 = new YogaNode();
|
||||||
|
root_child0_child0_child0.SetMargin(YogaEdge.Left, 5.Percent());
|
||||||
|
root_child0_child0_child0.SetMargin(YogaEdge.Top, 5.Percent());
|
||||||
|
root_child0_child0_child0.SetMargin(YogaEdge.Right, 5.Percent());
|
||||||
|
root_child0_child0_child0.SetMargin(YogaEdge.Bottom, 5.Percent());
|
||||||
|
root_child0_child0_child0.SetPadding(YogaEdge.Left, 3);
|
||||||
|
root_child0_child0_child0.SetPadding(YogaEdge.Top, 3);
|
||||||
|
root_child0_child0_child0.SetPadding(YogaEdge.Right, 3);
|
||||||
|
root_child0_child0_child0.SetPadding(YogaEdge.Bottom, 3);
|
||||||
|
root_child0_child0_child0.Width = 45.Percent();
|
||||||
|
root_child0_child0.Insert(0, root_child0_child0_child0);
|
||||||
|
|
||||||
|
YogaNode root_child1 = new YogaNode();
|
||||||
|
root_child1.FlexGrow = 4;
|
||||||
|
root_child1.FlexBasis = 15.Percent();
|
||||||
|
root_child1.MinWidth = 20.Percent();
|
||||||
|
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(5f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(5f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(190f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(48f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(8f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(8f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(92f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(25f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(10f, root_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(10f, root_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(6f, root_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(58f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(142f, 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(5f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(5f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(190f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(48f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(90f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(8f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(92f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(25f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(46f, root_child0_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(10f, root_child0_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(36f, root_child0_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(6f, root_child0_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child1.LayoutX);
|
||||||
|
Assert.AreEqual(58f, root_child1.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child1.LayoutWidth);
|
||||||
|
Assert.AreEqual(142f, root_child1.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_margin_should_calculate_based_only_on_width()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 100;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.SetMargin(YogaEdge.Left, 10.Percent());
|
||||||
|
root_child0.SetMargin(YogaEdge.Top, 10.Percent());
|
||||||
|
root_child0.SetMargin(YogaEdge.Right, 10.Percent());
|
||||||
|
root_child0.SetMargin(YogaEdge.Bottom, 10.Percent());
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0 = new YogaNode();
|
||||||
|
root_child0_child0.Width = 10;
|
||||||
|
root_child0_child0.Height = 10;
|
||||||
|
root_child0.Insert(0, root_child0_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(160f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(60f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(10f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(20f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(160f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(60f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(150f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(10f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_padding_should_calculate_based_only_on_width()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 100;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.FlexGrow = 1;
|
||||||
|
root_child0.SetPadding(YogaEdge.Left, 10.Percent());
|
||||||
|
root_child0.SetPadding(YogaEdge.Top, 10.Percent());
|
||||||
|
root_child0.SetPadding(YogaEdge.Right, 10.Percent());
|
||||||
|
root_child0.SetPadding(YogaEdge.Bottom, 10.Percent());
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
|
YogaNode root_child0_child0 = new YogaNode();
|
||||||
|
root_child0_child0.Width = 10;
|
||||||
|
root_child0_child0.Height = 10;
|
||||||
|
root_child0.Insert(0, root_child0_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(20f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(20f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(10f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(170f, root_child0_child0.LayoutX);
|
||||||
|
Assert.AreEqual(20f, root_child0_child0.LayoutY);
|
||||||
|
Assert.AreEqual(10f, root_child0_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child0_child0.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Test]
|
||||||
|
public void Test_percentage_absolute_position()
|
||||||
|
{
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
|
YogaNode root = new YogaNode();
|
||||||
|
root.Width = 200;
|
||||||
|
root.Height = 100;
|
||||||
|
|
||||||
|
YogaNode root_child0 = new YogaNode();
|
||||||
|
root_child0.PositionType = YogaPositionType.Absolute;
|
||||||
|
root_child0.SetPosition(YogaEdge.Left, 30.Percent());
|
||||||
|
root_child0.SetPosition(YogaEdge.Top, 10.Percent());
|
||||||
|
root_child0.Width = 10;
|
||||||
|
root_child0.Height = 10;
|
||||||
|
root.Insert(0, root_child0);
|
||||||
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(60f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(10f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
root.StyleDirection = YogaDirection.RTL;
|
||||||
|
root.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(0f, root.LayoutX);
|
||||||
|
Assert.AreEqual(0f, root.LayoutY);
|
||||||
|
Assert.AreEqual(200f, root.LayoutWidth);
|
||||||
|
Assert.AreEqual(100f, root.LayoutHeight);
|
||||||
|
|
||||||
|
Assert.AreEqual(60f, root_child0.LayoutX);
|
||||||
|
Assert.AreEqual(10f, root_child0.LayoutY);
|
||||||
|
Assert.AreEqual(10f, root_child0.LayoutWidth);
|
||||||
|
Assert.AreEqual(10f, root_child0.LayoutHeight);
|
||||||
|
|
||||||
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, false);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@@ -24,19 +24,19 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.FlexGrow = 1f;
|
root_child2.FlexGrow = 1;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -94,27 +94,27 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 113f;
|
root.Width = 113;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.FlexGrow = 1f;
|
root_child2.FlexGrow = 1;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
|
|
||||||
YogaNode root_child3 = new YogaNode();
|
YogaNode root_child3 = new YogaNode();
|
||||||
root_child3.FlexGrow = 1f;
|
root_child3.FlexGrow = 1;
|
||||||
root.Insert(3, root_child3);
|
root.Insert(3, root_child3);
|
||||||
|
|
||||||
YogaNode root_child4 = new YogaNode();
|
YogaNode root_child4 = new YogaNode();
|
||||||
root_child4.FlexGrow = 1f;
|
root_child4.FlexGrow = 1;
|
||||||
root.Insert(4, root_child4);
|
root.Insert(4, root_child4);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -192,20 +192,20 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.FlexDirection = YogaFlexDirection.Row;
|
root.FlexDirection = YogaFlexDirection.Row;
|
||||||
root.Width = 101f;
|
root.Width = 101;
|
||||||
root.Height = 100f;
|
root.Height = 100;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexShrink = 1f;
|
root_child0.FlexShrink = 1;
|
||||||
root_child0.FlexBasis = 100f;
|
root_child0.FlexBasis = 100;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexBasis = 25f;
|
root_child1.FlexBasis = 25;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.FlexBasis = 25f;
|
root_child2.FlexBasis = 25;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -262,23 +262,23 @@ namespace Facebook.Yoga
|
|||||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 113f;
|
root.Height = 113;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.FlexBasis = 50f;
|
root_child0.FlexBasis = 50;
|
||||||
root_child0.Height = 20f;
|
root_child0.Height = 20;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.FlexGrow = 1f;
|
root_child2.FlexGrow = 1;
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -346,7 +346,7 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1.6f;
|
root_child1.FlexGrow = 1.6f;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
@@ -418,14 +418,14 @@ namespace Facebook.Yoga
|
|||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child0_child0 = new YogaNode();
|
YogaNode root_child0_child0 = new YogaNode();
|
||||||
root_child0_child0.FlexGrow = 1f;
|
root_child0_child0.FlexGrow = 1;
|
||||||
root_child0_child0.FlexBasis = 0.3f;
|
root_child0_child0.FlexBasis = 0.3f;
|
||||||
root_child0_child0.SetPosition(YogaEdge.Bottom, 13.3f);
|
root_child0_child0.SetPosition(YogaEdge.Bottom, 13.3f);
|
||||||
root_child0_child0.Height = 9.9f;
|
root_child0_child0.Height = 9.9f;
|
||||||
root_child0.Insert(0, root_child0_child0);
|
root_child0.Insert(0, root_child0_child0);
|
||||||
|
|
||||||
YogaNode root_child0_child1 = new YogaNode();
|
YogaNode root_child0_child1 = new YogaNode();
|
||||||
root_child0_child1.FlexGrow = 4f;
|
root_child0_child1.FlexGrow = 4;
|
||||||
root_child0_child1.FlexBasis = 0.3f;
|
root_child0_child1.FlexBasis = 0.3f;
|
||||||
root_child0_child1.SetPosition(YogaEdge.Top, 13.3f);
|
root_child0_child1.SetPosition(YogaEdge.Top, 13.3f);
|
||||||
root_child0_child1.Height = 1.1f;
|
root_child0_child1.Height = 1.1f;
|
||||||
@@ -433,7 +433,7 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1.6f;
|
root_child1.FlexGrow = 1.6f;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
@@ -515,23 +515,23 @@ namespace Facebook.Yoga
|
|||||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 113.4f;
|
root.Height = 113.4f;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.FlexBasis = 50f;
|
root_child0.FlexBasis = 50;
|
||||||
root_child0.Height = 20f;
|
root_child0.Height = 20;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.FlexGrow = 1f;
|
root_child2.FlexGrow = 1;
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -588,23 +588,23 @@ namespace Facebook.Yoga
|
|||||||
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
YogaNode.SetExperimentalFeatureEnabled(YogaExperimentalFeature.Rounding, true);
|
||||||
|
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 113.6f;
|
root.Height = 113.6f;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.FlexBasis = 50f;
|
root_child0.FlexBasis = 50;
|
||||||
root_child0.Height = 20f;
|
root_child0.Height = 20;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.FlexGrow = 1f;
|
root_child2.FlexGrow = 1;
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -662,23 +662,23 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetPosition(YogaEdge.Top, 0.3f);
|
root.SetPosition(YogaEdge.Top, 0.3f);
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 113.4f;
|
root.Height = 113.4f;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.FlexBasis = 50f;
|
root_child0.FlexBasis = 50;
|
||||||
root_child0.Height = 20f;
|
root_child0.Height = 20;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.FlexGrow = 1f;
|
root_child2.FlexGrow = 1;
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
@@ -736,23 +736,23 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
YogaNode root = new YogaNode();
|
YogaNode root = new YogaNode();
|
||||||
root.SetPosition(YogaEdge.Top, 0.7f);
|
root.SetPosition(YogaEdge.Top, 0.7f);
|
||||||
root.Width = 100f;
|
root.Width = 100;
|
||||||
root.Height = 113.4f;
|
root.Height = 113.4f;
|
||||||
|
|
||||||
YogaNode root_child0 = new YogaNode();
|
YogaNode root_child0 = new YogaNode();
|
||||||
root_child0.FlexGrow = 1f;
|
root_child0.FlexGrow = 1;
|
||||||
root_child0.FlexBasis = 50f;
|
root_child0.FlexBasis = 50;
|
||||||
root_child0.Height = 20f;
|
root_child0.Height = 20;
|
||||||
root.Insert(0, root_child0);
|
root.Insert(0, root_child0);
|
||||||
|
|
||||||
YogaNode root_child1 = new YogaNode();
|
YogaNode root_child1 = new YogaNode();
|
||||||
root_child1.FlexGrow = 1f;
|
root_child1.FlexGrow = 1;
|
||||||
root_child1.Height = 10f;
|
root_child1.Height = 10;
|
||||||
root.Insert(1, root_child1);
|
root.Insert(1, root_child1);
|
||||||
|
|
||||||
YogaNode root_child2 = new YogaNode();
|
YogaNode root_child2 = new YogaNode();
|
||||||
root_child2.FlexGrow = 1f;
|
root_child2.FlexGrow = 1;
|
||||||
root_child2.Height = 10f;
|
root_child2.Height = 10;
|
||||||
root.Insert(2, root_child2);
|
root.Insert(2, root_child2);
|
||||||
root.StyleDirection = YogaDirection.LTR;
|
root.StyleDirection = YogaDirection.LTR;
|
||||||
root.CalculateLayout();
|
root.CalculateLayout();
|
||||||
|
@@ -51,14 +51,14 @@ namespace Facebook.Yoga
|
|||||||
Assert.AreEqual(YogaFlexDirection.Column, node.FlexDirection);
|
Assert.AreEqual(YogaFlexDirection.Column, node.FlexDirection);
|
||||||
Assert.AreEqual(YogaPositionType.Absolute, node.PositionType);
|
Assert.AreEqual(YogaPositionType.Absolute, node.PositionType);
|
||||||
Assert.AreEqual(YogaWrap.Wrap, node.Wrap);
|
Assert.AreEqual(YogaWrap.Wrap, node.Wrap);
|
||||||
Assert.AreEqual(6, node.GetPosition(YogaEdge.Top));
|
Assert.AreEqual(6.Px(), node.GetPosition(YogaEdge.Top));
|
||||||
Assert.IsTrue(YogaConstants.IsUndefined(node.GetPosition(YogaEdge.Bottom)));
|
Assert.IsTrue(YogaConstants.IsUndefined(node.GetPosition(YogaEdge.Bottom)));
|
||||||
Assert.AreEqual(4, node.GetPosition(YogaEdge.Right));
|
Assert.AreEqual(4.Px(), node.GetPosition(YogaEdge.Right));
|
||||||
Assert.IsTrue(YogaConstants.IsUndefined(node.GetPosition(YogaEdge.Left)));
|
Assert.IsTrue(YogaConstants.IsUndefined(node.GetPosition(YogaEdge.Left)));
|
||||||
Assert.AreEqual(0, node.GetMargin(YogaEdge.Top));
|
Assert.AreEqual(0.Px(), node.GetMargin(YogaEdge.Top));
|
||||||
Assert.AreEqual(5, node.GetMargin(YogaEdge.Bottom));
|
Assert.AreEqual(5.Px(), node.GetMargin(YogaEdge.Bottom));
|
||||||
Assert.AreEqual(3, node.GetMargin(YogaEdge.Left));
|
Assert.AreEqual(3.Px(), node.GetMargin(YogaEdge.Left));
|
||||||
Assert.AreEqual(0, node.GetMargin(YogaEdge.Right));
|
Assert.AreEqual(0.Px(), node.GetMargin(YogaEdge.Right));
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -85,7 +85,7 @@ namespace Facebook.Yoga
|
|||||||
position: new Spacing(top: 5, bottom: 6, left: 7, right: 8),
|
position: new Spacing(top: 5, bottom: 6, left: 7, right: 8),
|
||||||
margin: new Spacing(top: 9, bottom: 10, left: 11, right: 12),
|
margin: new Spacing(top: 9, bottom: 10, left: 11, right: 12),
|
||||||
padding: new Spacing(top: 13, bottom: 14, left: 15, right: 16),
|
padding: new Spacing(top: 13, bottom: 14, left: 15, right: 16),
|
||||||
border: new Spacing(top: 17, bottom: 18, left: 19, right: 20),
|
border: new Border(top: 17, bottom: 18, left: 19, right: 20),
|
||||||
|
|
||||||
width: 21,
|
width: 21,
|
||||||
height: 22,
|
height: 22,
|
||||||
@@ -108,36 +108,36 @@ namespace Facebook.Yoga
|
|||||||
|
|
||||||
Assert.AreEqual(2, node.FlexGrow);
|
Assert.AreEqual(2, node.FlexGrow);
|
||||||
Assert.AreEqual(3, node.FlexShrink);
|
Assert.AreEqual(3, node.FlexShrink);
|
||||||
Assert.AreEqual(4, node.FlexBasis);
|
Assert.AreEqual(4.Px(), node.FlexBasis);
|
||||||
node.FlexGrow = YogaConstants.Undefined;
|
node.FlexGrow = YogaConstants.Undefined;
|
||||||
Assert.AreEqual(1, node.FlexGrow);
|
Assert.AreEqual(1, node.FlexGrow);
|
||||||
|
|
||||||
Assert.AreEqual(5, node.GetPosition(YogaEdge.Top));
|
Assert.AreEqual(5.Px(), node.GetPosition(YogaEdge.Top));
|
||||||
Assert.AreEqual(6, node.GetPosition(YogaEdge.Bottom));
|
Assert.AreEqual(6.Px(), node.GetPosition(YogaEdge.Bottom));
|
||||||
Assert.AreEqual(7, node.GetPosition(YogaEdge.Left));
|
Assert.AreEqual(7.Px(), node.GetPosition(YogaEdge.Left));
|
||||||
Assert.AreEqual(8, node.GetPosition(YogaEdge.Right));
|
Assert.AreEqual(8.Px(), node.GetPosition(YogaEdge.Right));
|
||||||
|
|
||||||
Assert.AreEqual(9, node.GetMargin(YogaEdge.Top));
|
Assert.AreEqual(9.Px(), node.GetMargin(YogaEdge.Top));
|
||||||
Assert.AreEqual(10, node.GetMargin(YogaEdge.Bottom));
|
Assert.AreEqual(10.Px(), node.GetMargin(YogaEdge.Bottom));
|
||||||
Assert.AreEqual(11, node.GetMargin(YogaEdge.Left));
|
Assert.AreEqual(11.Px(), node.GetMargin(YogaEdge.Left));
|
||||||
Assert.AreEqual(12, node.GetMargin(YogaEdge.Right));
|
Assert.AreEqual(12.Px(), node.GetMargin(YogaEdge.Right));
|
||||||
|
|
||||||
Assert.AreEqual(13, node.GetPadding(YogaEdge.Top));
|
Assert.AreEqual(13.Px(), node.GetPadding(YogaEdge.Top));
|
||||||
Assert.AreEqual(14, node.GetPadding(YogaEdge.Bottom));
|
Assert.AreEqual(14.Px(), node.GetPadding(YogaEdge.Bottom));
|
||||||
Assert.AreEqual(15, node.GetPadding(YogaEdge.Left));
|
Assert.AreEqual(15.Px(), node.GetPadding(YogaEdge.Left));
|
||||||
Assert.AreEqual(16, node.GetPadding(YogaEdge.Right));
|
Assert.AreEqual(16.Px(), node.GetPadding(YogaEdge.Right));
|
||||||
|
|
||||||
Assert.AreEqual(17, node.GetBorder(YogaEdge.Top));
|
Assert.AreEqual(17, node.GetBorder(YogaEdge.Top));
|
||||||
Assert.AreEqual(18, node.GetBorder(YogaEdge.Bottom));
|
Assert.AreEqual(18, node.GetBorder(YogaEdge.Bottom));
|
||||||
Assert.AreEqual(19, node.GetBorder(YogaEdge.Left));
|
Assert.AreEqual(19, node.GetBorder(YogaEdge.Left));
|
||||||
Assert.AreEqual(20, node.GetBorder(YogaEdge.Right));
|
Assert.AreEqual(20, node.GetBorder(YogaEdge.Right));
|
||||||
|
|
||||||
Assert.AreEqual(21, node.Width);
|
Assert.AreEqual(21.Px(), node.Width);
|
||||||
Assert.AreEqual(22, node.Height);
|
Assert.AreEqual(22.Px(), node.Height);
|
||||||
Assert.AreEqual(23, node.MinWidth);
|
Assert.AreEqual(23.Px(), node.MinWidth);
|
||||||
Assert.AreEqual(24, node.MinHeight);
|
Assert.AreEqual(24.Px(), node.MinHeight);
|
||||||
Assert.AreEqual(25, node.MaxWidth);
|
Assert.AreEqual(25.Px(), node.MaxWidth);
|
||||||
Assert.AreEqual(26, node.MaxHeight);
|
Assert.AreEqual(26.Px(), node.MaxHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -169,8 +169,8 @@ namespace Facebook.Yoga
|
|||||||
return MeasureOutput.Make(123.4f, 81.7f);
|
return MeasureOutput.Make(123.4f, 81.7f);
|
||||||
});
|
});
|
||||||
node.CalculateLayout();
|
node.CalculateLayout();
|
||||||
Assert.AreEqual(123, node.LayoutWidth);
|
Assert.AreEqual(123.4f, node.LayoutWidth);
|
||||||
Assert.AreEqual(81, node.LayoutHeight);
|
Assert.AreEqual(81.7f, node.LayoutHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -212,7 +212,7 @@ namespace Facebook.Yoga
|
|||||||
parent.Insert(0, child0);
|
parent.Insert(0, child0);
|
||||||
parent.Insert(0, child1);
|
parent.Insert(0, child1);
|
||||||
parent.CalculateLayout();
|
parent.CalculateLayout();
|
||||||
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");
|
Assert.AreEqual("{layout: {width: 100, height: 120, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 100px, height: 120px, children: [\n {layout: {width: 35, height: 45, top: 0, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 35px, height: 45px, },\n {layout: {width: 30, height: 40, top: 45, left: 0}, flexDirection: 'column', alignItems: 'stretch', flexGrow: 0, flexShrink: 0, overflow: 'visible', width: 30px, height: 40px, },\n]},\n", parent.Print());
|
||||||
}
|
}
|
||||||
|
|
||||||
[Test]
|
[Test]
|
||||||
@@ -225,10 +225,9 @@ namespace Facebook.Yoga
|
|||||||
node1.MaxHeight = 100;
|
node1.MaxHeight = 100;
|
||||||
|
|
||||||
node0.CopyStyle(node1);
|
node0.CopyStyle(node1);
|
||||||
Assert.AreEqual(100, node0.MaxHeight);
|
Assert.AreEqual(100.Px(), node0.MaxHeight);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !UNITY_EDITOR
|
|
||||||
private void ForceGC()
|
private void ForceGC()
|
||||||
{
|
{
|
||||||
GC.Collect(GC.MaxGeneration);
|
GC.Collect(GC.MaxGeneration);
|
||||||
@@ -356,6 +355,22 @@ namespace Facebook.Yoga
|
|||||||
return MeasureOutput.Make(120, 130);
|
return MeasureOutput.Make(120, 130);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
[Test]
|
||||||
|
public void TestLayoutPadding() {
|
||||||
|
YogaNode node = new YogaNode();
|
||||||
|
node.Width = 100;
|
||||||
|
node.Height = 100;
|
||||||
|
node.SetPadding(YogaEdge.Start, 1);
|
||||||
|
node.SetPadding(YogaEdge.End, 2);
|
||||||
|
node.SetPadding(YogaEdge.Top, 3);
|
||||||
|
node.SetPadding(YogaEdge.Bottom, 4);
|
||||||
|
node.CalculateLayout();
|
||||||
|
|
||||||
|
Assert.AreEqual(1, node.GetLayoutPadding(YogaEdge.Left));
|
||||||
|
Assert.AreEqual(2, node.GetLayoutPadding(YogaEdge.Right));
|
||||||
|
Assert.AreEqual(3, node.GetLayoutPadding(YogaEdge.Top));
|
||||||
|
Assert.AreEqual(4, node.GetLayoutPadding(YogaEdge.Bottom));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
6
docs/.gitignore
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
_site/
|
||||||
|
.sass-cache/
|
||||||
|
.DS_STORE
|
||||||
|
*.swo
|
||||||
|
*.swp
|
||||||
|
*.psd
|
115
docs/CONTRIBUTING.md
Normal file
@@ -0,0 +1,115 @@
|
|||||||
|
This provides guidance on how to contribute various content to `your-site`.
|
||||||
|
|
||||||
|
## Getting started
|
||||||
|
|
||||||
|
You should only have to do these one time.
|
||||||
|
|
||||||
|
- Rename this file to `CONTRIBUTING.md`.
|
||||||
|
- Rename `EXAMPLE-README-FOR-RUNNING-DOCS.md` to `README.md` (replacing the existing `README.md` that came with the template).
|
||||||
|
- Rename `EXAMPLE-LICENSE` to `LICENSE`.
|
||||||
|
- Review the [template information](./TEMPLATE-INFORMATION.md).
|
||||||
|
- Review `./_config.yml`.
|
||||||
|
- Make sure you update `title`, `description`, `tagline` and `gacode` (Google Analytics) in `./_config.yml`.
|
||||||
|
|
||||||
|
## Basic Structure
|
||||||
|
|
||||||
|
Most content is written in markdown. You name the file `something.md`, then have a header that looks like this:
|
||||||
|
|
||||||
|
```
|
||||||
|
---
|
||||||
|
docid: getting-started
|
||||||
|
title: Getting started with ProjectName
|
||||||
|
layout: docs
|
||||||
|
permalink: /docs/getting-started.html
|
||||||
|
---
|
||||||
|
```
|
||||||
|
|
||||||
|
Customize these values for each document, blog post, etc.
|
||||||
|
|
||||||
|
> The filename of the `.md` file doesn't actually matter; what is important is the `docid` being unique and the `permalink` correct and unique too).
|
||||||
|
|
||||||
|
## Landing page
|
||||||
|
|
||||||
|
Modify `index.md` with your new or updated content.
|
||||||
|
|
||||||
|
If you want a `GridBlock` as part of your content, you can do so directly with HTML:
|
||||||
|
|
||||||
|
```
|
||||||
|
<div class="gridBlock">
|
||||||
|
<div class="blockElement twoByGridBlock alignLeft">
|
||||||
|
<div class="blockContent">
|
||||||
|
<h3>Your Features</h3>
|
||||||
|
<ul>
|
||||||
|
<li>The <a href="http://example.org/">Example</a></li>
|
||||||
|
<li><a href="http://example.com">Another Example</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="blockElement twoByGridBlock alignLeft">
|
||||||
|
<div class="blockContent">
|
||||||
|
<h3>More information</h3>
|
||||||
|
<p>
|
||||||
|
Stuff here
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
```
|
||||||
|
|
||||||
|
or with a combination of changing `./_data/features.yml` and adding some Liquid to `index.md`, such as:
|
||||||
|
|
||||||
|
```
|
||||||
|
{% include content/gridblocks.html data_source=site.data.features imagealign="bottom"%}
|
||||||
|
```
|
||||||
|
|
||||||
|
## Blog
|
||||||
|
|
||||||
|
To modify a blog post, edit the appopriate markdown file in `./_posts/`.
|
||||||
|
|
||||||
|
Adding a new blog post is a four-step process.
|
||||||
|
|
||||||
|
> Some posts have a `permalink` and `comments` in the blog post YAML header. You will not need these for new blog posts. These are an artifact of migrating the blog from Wordpress to gh-pages.
|
||||||
|
|
||||||
|
1. Create your blog post in `./_posts/` in markdown (file extension `.md` or `.markdown`). See current posts in that folder or `./doc-type-examples/2016-04-07-blog-post-example.md` for an example of the YAML format. **If the `./_posts` directory does not exist, create it**.
|
||||||
|
- You can add a `<!--truncate-->` tag in the middle of your post such that you show only the excerpt above that tag in the main `/blog` index on your page.
|
||||||
|
1. If you have not authored a blog post before, modify the `./_data/authors.yml` file with the `author` id you used in your blog post, along with your full name and Facebook ID to get your profile picture.
|
||||||
|
1. [Run the site locally](./README.md) to test your changes. It will be at `http://127.0.0.1/blog/your-new-blog-post-title.html`
|
||||||
|
1. Push your changes to GitHub.
|
||||||
|
|
||||||
|
## Docs
|
||||||
|
|
||||||
|
To modify docs, edit the appropriate markdown file in `./_docs/`.
|
||||||
|
|
||||||
|
To add docs to the site....
|
||||||
|
|
||||||
|
1. Add your markdown file to the `./_docs/` folder. See `./doc-type-examples/docs-hello-world.md` for an example of the YAML header format. **If the `./_docs/` directory does not exist, create it**.
|
||||||
|
- You can use folders in the `./_docs/` directory to organize your content if you want.
|
||||||
|
1. Update `_data/nav_docs.yml` to add your new document to the navigation bar. Use the `docid` you put in your doc markdown in as the `id` in the `_data/nav_docs.yml` file.
|
||||||
|
1. [Run the site locally](./README.md) to test your changes. It will be at `http://127.0.0.1/docs/your-new-doc-permalink.html`
|
||||||
|
1. Push your changes to GitHub.
|
||||||
|
|
||||||
|
## Header Bar
|
||||||
|
|
||||||
|
To modify the header bar, change `./_data/nav.yml`.
|
||||||
|
|
||||||
|
## Top Level Page
|
||||||
|
|
||||||
|
To modify a top-level page, edit the appropriate markdown file in `./top-level/`
|
||||||
|
|
||||||
|
If you want a top-level page (e.g., http://your-site.com/top-level.html) -- not in `/blog/` or `/docs/`....
|
||||||
|
|
||||||
|
1. Create a markdown file in the root `./top-level/`. See `./doc-type-examples/top-level-example.md` for more information.
|
||||||
|
1. If you want a visible link to that file, update `_data/nav.yml` to add a link to your new top-level document in the header bar.
|
||||||
|
|
||||||
|
> This is not necessary if you just want to have a page that is linked to from another page, but not exposed as direct link to the user.
|
||||||
|
|
||||||
|
1. [Run the site locally](./README.md) to test your changes. It will be at `http://127.0.0.1/your-top-level-page-permalink.html`
|
||||||
|
1. Push your changes to GitHub.
|
||||||
|
|
||||||
|
## Other Changes
|
||||||
|
|
||||||
|
- CSS: `./css/main.css` or `./_sass/*.scss`.
|
||||||
|
- Images: `./static/images/[docs | posts]/....`
|
||||||
|
- Main Blog post HTML: `./_includes/post.html`
|
||||||
|
- Main Docs HTML: `./_includes/doc.html`
|
2
docs/Gemfile
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
source 'https://rubygems.org'
|
||||||
|
gem 'github-pages', '~> 104'
|
145
docs/Gemfile.lock
Normal file
@@ -0,0 +1,145 @@
|
|||||||
|
GEM
|
||||||
|
remote: https://rubygems.org/
|
||||||
|
specs:
|
||||||
|
activesupport (4.2.7)
|
||||||
|
i18n (~> 0.7)
|
||||||
|
json (~> 1.7, >= 1.7.7)
|
||||||
|
minitest (~> 5.1)
|
||||||
|
thread_safe (~> 0.3, >= 0.3.4)
|
||||||
|
tzinfo (~> 1.1)
|
||||||
|
addressable (2.4.0)
|
||||||
|
coffee-script (2.4.1)
|
||||||
|
coffee-script-source
|
||||||
|
execjs
|
||||||
|
coffee-script-source (1.10.0)
|
||||||
|
colorator (1.1.0)
|
||||||
|
ethon (0.9.1)
|
||||||
|
ffi (>= 1.3.0)
|
||||||
|
execjs (2.7.0)
|
||||||
|
faraday (0.9.2)
|
||||||
|
multipart-post (>= 1.2, < 3)
|
||||||
|
ffi (1.9.14)
|
||||||
|
forwardable-extended (2.6.0)
|
||||||
|
gemoji (2.1.0)
|
||||||
|
github-pages (104)
|
||||||
|
activesupport (= 4.2.7)
|
||||||
|
github-pages-health-check (= 1.2.0)
|
||||||
|
jekyll (= 3.3.0)
|
||||||
|
jekyll-avatar (= 0.4.2)
|
||||||
|
jekyll-coffeescript (= 1.0.1)
|
||||||
|
jekyll-feed (= 0.8.0)
|
||||||
|
jekyll-gist (= 1.4.0)
|
||||||
|
jekyll-github-metadata (= 2.2.0)
|
||||||
|
jekyll-mentions (= 1.2.0)
|
||||||
|
jekyll-paginate (= 1.1.0)
|
||||||
|
jekyll-redirect-from (= 0.11.0)
|
||||||
|
jekyll-sass-converter (= 1.3.0)
|
||||||
|
jekyll-seo-tag (= 2.1.0)
|
||||||
|
jekyll-sitemap (= 0.12.0)
|
||||||
|
jekyll-swiss (= 0.4.0)
|
||||||
|
jemoji (= 0.7.0)
|
||||||
|
kramdown (= 1.11.1)
|
||||||
|
liquid (= 3.0.6)
|
||||||
|
listen (= 3.0.6)
|
||||||
|
mercenary (~> 0.3)
|
||||||
|
minima (= 2.0.0)
|
||||||
|
rouge (= 1.11.1)
|
||||||
|
terminal-table (~> 1.4)
|
||||||
|
github-pages-health-check (1.2.0)
|
||||||
|
addressable (~> 2.3)
|
||||||
|
net-dns (~> 0.8)
|
||||||
|
octokit (~> 4.0)
|
||||||
|
public_suffix (~> 1.4)
|
||||||
|
typhoeus (~> 0.7)
|
||||||
|
html-pipeline (2.4.2)
|
||||||
|
activesupport (>= 2)
|
||||||
|
nokogiri (>= 1.4)
|
||||||
|
i18n (0.7.0)
|
||||||
|
jekyll (3.3.0)
|
||||||
|
addressable (~> 2.4)
|
||||||
|
colorator (~> 1.0)
|
||||||
|
jekyll-sass-converter (~> 1.0)
|
||||||
|
jekyll-watch (~> 1.1)
|
||||||
|
kramdown (~> 1.3)
|
||||||
|
liquid (~> 3.0)
|
||||||
|
mercenary (~> 0.3.3)
|
||||||
|
pathutil (~> 0.9)
|
||||||
|
rouge (~> 1.7)
|
||||||
|
safe_yaml (~> 1.0)
|
||||||
|
jekyll-avatar (0.4.2)
|
||||||
|
jekyll (~> 3.0)
|
||||||
|
jekyll-coffeescript (1.0.1)
|
||||||
|
coffee-script (~> 2.2)
|
||||||
|
jekyll-feed (0.8.0)
|
||||||
|
jekyll (~> 3.3)
|
||||||
|
jekyll-gist (1.4.0)
|
||||||
|
octokit (~> 4.2)
|
||||||
|
jekyll-github-metadata (2.2.0)
|
||||||
|
jekyll (~> 3.1)
|
||||||
|
octokit (~> 4.0, != 4.4.0)
|
||||||
|
jekyll-mentions (1.2.0)
|
||||||
|
activesupport (~> 4.0)
|
||||||
|
html-pipeline (~> 2.3)
|
||||||
|
jekyll (~> 3.0)
|
||||||
|
jekyll-paginate (1.1.0)
|
||||||
|
jekyll-redirect-from (0.11.0)
|
||||||
|
jekyll (>= 2.0)
|
||||||
|
jekyll-sass-converter (1.3.0)
|
||||||
|
sass (~> 3.2)
|
||||||
|
jekyll-seo-tag (2.1.0)
|
||||||
|
jekyll (~> 3.3)
|
||||||
|
jekyll-sitemap (0.12.0)
|
||||||
|
jekyll (~> 3.3)
|
||||||
|
jekyll-swiss (0.4.0)
|
||||||
|
jekyll-watch (1.5.0)
|
||||||
|
listen (~> 3.0, < 3.1)
|
||||||
|
jemoji (0.7.0)
|
||||||
|
activesupport (~> 4.0)
|
||||||
|
gemoji (~> 2.0)
|
||||||
|
html-pipeline (~> 2.2)
|
||||||
|
jekyll (>= 3.0)
|
||||||
|
json (1.8.3)
|
||||||
|
kramdown (1.11.1)
|
||||||
|
liquid (3.0.6)
|
||||||
|
listen (3.0.6)
|
||||||
|
rb-fsevent (>= 0.9.3)
|
||||||
|
rb-inotify (>= 0.9.7)
|
||||||
|
mercenary (0.3.6)
|
||||||
|
mini_portile2 (2.1.0)
|
||||||
|
minima (2.0.0)
|
||||||
|
minitest (5.9.1)
|
||||||
|
multipart-post (2.0.0)
|
||||||
|
net-dns (0.8.0)
|
||||||
|
nokogiri (1.6.8.1)
|
||||||
|
mini_portile2 (~> 2.1.0)
|
||||||
|
octokit (4.4.1)
|
||||||
|
sawyer (~> 0.7.0, >= 0.5.3)
|
||||||
|
pathutil (0.14.0)
|
||||||
|
forwardable-extended (~> 2.6)
|
||||||
|
public_suffix (1.5.3)
|
||||||
|
rb-fsevent (0.9.8)
|
||||||
|
rb-inotify (0.9.7)
|
||||||
|
ffi (>= 0.5.0)
|
||||||
|
rouge (1.11.1)
|
||||||
|
safe_yaml (1.0.4)
|
||||||
|
sass (3.4.22)
|
||||||
|
sawyer (0.7.0)
|
||||||
|
addressable (>= 2.3.5, < 2.5)
|
||||||
|
faraday (~> 0.8, < 0.10)
|
||||||
|
terminal-table (1.7.3)
|
||||||
|
unicode-display_width (~> 1.1.1)
|
||||||
|
thread_safe (0.3.5)
|
||||||
|
typhoeus (0.8.0)
|
||||||
|
ethon (>= 0.8.0)
|
||||||
|
tzinfo (1.2.2)
|
||||||
|
thread_safe (~> 0.1)
|
||||||
|
unicode-display_width (1.1.1)
|
||||||
|
|
||||||
|
PLATFORMS
|
||||||
|
ruby
|
||||||
|
|
||||||
|
DEPENDENCIES
|
||||||
|
github-pages (~> 104)
|
||||||
|
|
||||||
|
BUNDLED WITH
|
||||||
|
1.13.1
|
385
docs/LICENSE
Normal file
@@ -0,0 +1,385 @@
|
|||||||
|
Attribution 4.0 International
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons Corporation ("Creative Commons") is not a law firm and
|
||||||
|
does not provide legal services or legal advice. Distribution of
|
||||||
|
Creative Commons public licenses does not create a lawyer-client or
|
||||||
|
other relationship. Creative Commons makes its licenses and related
|
||||||
|
information available on an "as-is" basis. Creative Commons gives no
|
||||||
|
warranties regarding its licenses, any material licensed under their
|
||||||
|
terms and conditions, or any related information. Creative Commons
|
||||||
|
disclaims all liability for damages resulting from their use to the
|
||||||
|
fullest extent possible.
|
||||||
|
|
||||||
|
Using Creative Commons Public Licenses
|
||||||
|
|
||||||
|
Creative Commons public licenses provide a standard set of terms and
|
||||||
|
conditions that creators and other rights holders may use to share
|
||||||
|
original works of authorship and other material subject to copyright
|
||||||
|
and certain other rights specified in the public license below. The
|
||||||
|
following considerations are for informational purposes only, are not
|
||||||
|
exhaustive, and do not form part of our licenses.
|
||||||
|
|
||||||
|
Considerations for licensors: Our public licenses are
|
||||||
|
intended for use by those authorized to give the public
|
||||||
|
permission to use material in ways otherwise restricted by
|
||||||
|
copyright and certain other rights. Our licenses are
|
||||||
|
irrevocable. Licensors should read and understand the terms
|
||||||
|
and conditions of the license they choose before applying it.
|
||||||
|
Licensors should also secure all rights necessary before
|
||||||
|
applying our licenses so that the public can reuse the
|
||||||
|
material as expected. Licensors should clearly mark any
|
||||||
|
material not subject to the license. This includes other CC-
|
||||||
|
licensed material, or material used under an exception or
|
||||||
|
limitation to copyright. More considerations for licensors:
|
||||||
|
wiki.creativecommons.org/Considerations_for_licensors
|
||||||
|
|
||||||
|
Considerations for the public: By using one of our public
|
||||||
|
licenses, a licensor grants the public permission to use the
|
||||||
|
licensed material under specified terms and conditions. If
|
||||||
|
the licensor's permission is not necessary for any reason--for
|
||||||
|
example, because of any applicable exception or limitation to
|
||||||
|
copyright--then that use is not regulated by the license. Our
|
||||||
|
licenses grant only permissions under copyright and certain
|
||||||
|
other rights that a licensor has authority to grant. Use of
|
||||||
|
the licensed material may still be restricted for other
|
||||||
|
reasons, including because others have copyright or other
|
||||||
|
rights in the material. A licensor may make special requests,
|
||||||
|
such as asking that all changes be marked or described.
|
||||||
|
Although not required by our licenses, you are encouraged to
|
||||||
|
respect those requests where reasonable. More_considerations
|
||||||
|
for the public:
|
||||||
|
wiki.creativecommons.org/Considerations_for_licensees
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons Attribution 4.0 International Public License
|
||||||
|
|
||||||
|
By exercising the Licensed Rights (defined below), You accept and agree
|
||||||
|
to be bound by the terms and conditions of this Creative Commons
|
||||||
|
Attribution 4.0 International Public License ("Public License"). To the
|
||||||
|
extent this Public License may be interpreted as a contract, You are
|
||||||
|
granted the Licensed Rights in consideration of Your acceptance of
|
||||||
|
these terms and conditions, and the Licensor grants You such rights in
|
||||||
|
consideration of benefits the Licensor receives from making the
|
||||||
|
Licensed Material available under these terms and conditions.
|
||||||
|
|
||||||
|
Section 1 -- Definitions.
|
||||||
|
|
||||||
|
a. Adapted Material means material subject to Copyright and Similar
|
||||||
|
Rights that is derived from or based upon the Licensed Material
|
||||||
|
and in which the Licensed Material is translated, altered,
|
||||||
|
arranged, transformed, or otherwise modified in a manner requiring
|
||||||
|
permission under the Copyright and Similar Rights held by the
|
||||||
|
Licensor. For purposes of this Public License, where the Licensed
|
||||||
|
Material is a musical work, performance, or sound recording,
|
||||||
|
Adapted Material is always produced where the Licensed Material is
|
||||||
|
synched in timed relation with a moving image.
|
||||||
|
|
||||||
|
b. Adapter's License means the license You apply to Your Copyright
|
||||||
|
and Similar Rights in Your contributions to Adapted Material in
|
||||||
|
accordance with the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
c. Copyright and Similar Rights means copyright and/or similar rights
|
||||||
|
closely related to copyright including, without limitation,
|
||||||
|
performance, broadcast, sound recording, and Sui Generis Database
|
||||||
|
Rights, without regard to how the rights are labeled or
|
||||||
|
categorized. For purposes of this Public License, the rights
|
||||||
|
specified in Section 2(b)(1)-(2) are not Copyright and Similar
|
||||||
|
Rights.
|
||||||
|
|
||||||
|
d. Effective Technological Measures means those measures that, in the
|
||||||
|
absence of proper authority, may not be circumvented under laws
|
||||||
|
fulfilling obligations under Article 11 of the WIPO Copyright
|
||||||
|
Treaty adopted on December 20, 1996, and/or similar international
|
||||||
|
agreements.
|
||||||
|
|
||||||
|
e. Exceptions and Limitations means fair use, fair dealing, and/or
|
||||||
|
any other exception or limitation to Copyright and Similar Rights
|
||||||
|
that applies to Your use of the Licensed Material.
|
||||||
|
|
||||||
|
f. Licensed Material means the artistic or literary work, database,
|
||||||
|
or other material to which the Licensor applied this Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
g. Licensed Rights means the rights granted to You subject to the
|
||||||
|
terms and conditions of this Public License, which are limited to
|
||||||
|
all Copyright and Similar Rights that apply to Your use of the
|
||||||
|
Licensed Material and that the Licensor has authority to license.
|
||||||
|
|
||||||
|
h. Licensor means the individual(s) or entity(ies) granting rights
|
||||||
|
under this Public License.
|
||||||
|
|
||||||
|
i. Share means to provide material to the public by any means or
|
||||||
|
process that requires permission under the Licensed Rights, such
|
||||||
|
as reproduction, public display, public performance, distribution,
|
||||||
|
dissemination, communication, or importation, and to make material
|
||||||
|
available to the public including in ways that members of the
|
||||||
|
public may access the material from a place and at a time
|
||||||
|
individually chosen by them.
|
||||||
|
|
||||||
|
j. Sui Generis Database Rights means rights other than copyright
|
||||||
|
resulting from Directive 96/9/EC of the European Parliament and of
|
||||||
|
the Council of 11 March 1996 on the legal protection of databases,
|
||||||
|
as amended and/or succeeded, as well as other essentially
|
||||||
|
equivalent rights anywhere in the world.
|
||||||
|
|
||||||
|
k. You means the individual or entity exercising the Licensed Rights
|
||||||
|
under this Public License. Your has a corresponding meaning.
|
||||||
|
|
||||||
|
Section 2 -- Scope.
|
||||||
|
|
||||||
|
a. License grant.
|
||||||
|
|
||||||
|
1. Subject to the terms and conditions of this Public License,
|
||||||
|
the Licensor hereby grants You a worldwide, royalty-free,
|
||||||
|
non-sublicensable, non-exclusive, irrevocable license to
|
||||||
|
exercise the Licensed Rights in the Licensed Material to:
|
||||||
|
|
||||||
|
a. reproduce and Share the Licensed Material, in whole or
|
||||||
|
in part; and
|
||||||
|
|
||||||
|
b. produce, reproduce, and Share Adapted Material.
|
||||||
|
|
||||||
|
2. Exceptions and Limitations. For the avoidance of doubt, where
|
||||||
|
Exceptions and Limitations apply to Your use, this Public
|
||||||
|
License does not apply, and You do not need to comply with
|
||||||
|
its terms and conditions.
|
||||||
|
|
||||||
|
3. Term. The term of this Public License is specified in Section
|
||||||
|
6(a).
|
||||||
|
|
||||||
|
4. Media and formats; technical modifications allowed. The
|
||||||
|
Licensor authorizes You to exercise the Licensed Rights in
|
||||||
|
all media and formats whether now known or hereafter created,
|
||||||
|
and to make technical modifications necessary to do so. The
|
||||||
|
Licensor waives and/or agrees not to assert any right or
|
||||||
|
authority to forbid You from making technical modifications
|
||||||
|
necessary to exercise the Licensed Rights, including
|
||||||
|
technical modifications necessary to circumvent Effective
|
||||||
|
Technological Measures. For purposes of this Public License,
|
||||||
|
simply making modifications authorized by this Section 2(a)
|
||||||
|
(4) never produces Adapted Material.
|
||||||
|
|
||||||
|
5. Downstream recipients.
|
||||||
|
|
||||||
|
a. Offer from the Licensor -- Licensed Material. Every
|
||||||
|
recipient of the Licensed Material automatically
|
||||||
|
receives an offer from the Licensor to exercise the
|
||||||
|
Licensed Rights under the terms and conditions of this
|
||||||
|
Public License.
|
||||||
|
|
||||||
|
b. No downstream restrictions. You may not offer or impose
|
||||||
|
any additional or different terms or conditions on, or
|
||||||
|
apply any Effective Technological Measures to, the
|
||||||
|
Licensed Material if doing so restricts exercise of the
|
||||||
|
Licensed Rights by any recipient of the Licensed
|
||||||
|
Material.
|
||||||
|
|
||||||
|
6. No endorsement. Nothing in this Public License constitutes or
|
||||||
|
may be construed as permission to assert or imply that You
|
||||||
|
are, or that Your use of the Licensed Material is, connected
|
||||||
|
with, or sponsored, endorsed, or granted official status by,
|
||||||
|
the Licensor or others designated to receive attribution as
|
||||||
|
provided in Section 3(a)(1)(A)(i).
|
||||||
|
|
||||||
|
b. Other rights.
|
||||||
|
|
||||||
|
1. Moral rights, such as the right of integrity, are not
|
||||||
|
licensed under this Public License, nor are publicity,
|
||||||
|
privacy, and/or other similar personality rights; however, to
|
||||||
|
the extent possible, the Licensor waives and/or agrees not to
|
||||||
|
assert any such rights held by the Licensor to the limited
|
||||||
|
extent necessary to allow You to exercise the Licensed
|
||||||
|
Rights, but not otherwise.
|
||||||
|
|
||||||
|
2. Patent and trademark rights are not licensed under this
|
||||||
|
Public License.
|
||||||
|
|
||||||
|
3. To the extent possible, the Licensor waives any right to
|
||||||
|
collect royalties from You for the exercise of the Licensed
|
||||||
|
Rights, whether directly or through a collecting society
|
||||||
|
under any voluntary or waivable statutory or compulsory
|
||||||
|
licensing scheme. In all other cases the Licensor expressly
|
||||||
|
reserves any right to collect such royalties.
|
||||||
|
|
||||||
|
Section 3 -- License Conditions.
|
||||||
|
|
||||||
|
Your exercise of the Licensed Rights is expressly made subject to the
|
||||||
|
following conditions.
|
||||||
|
|
||||||
|
a. Attribution.
|
||||||
|
|
||||||
|
1. If You Share the Licensed Material (including in modified
|
||||||
|
form), You must:
|
||||||
|
|
||||||
|
a. retain the following if it is supplied by the Licensor
|
||||||
|
with the Licensed Material:
|
||||||
|
|
||||||
|
i. identification of the creator(s) of the Licensed
|
||||||
|
Material and any others designated to receive
|
||||||
|
attribution, in any reasonable manner requested by
|
||||||
|
the Licensor (including by pseudonym if
|
||||||
|
designated);
|
||||||
|
|
||||||
|
ii. a copyright notice;
|
||||||
|
|
||||||
|
iii. a notice that refers to this Public License;
|
||||||
|
|
||||||
|
iv. a notice that refers to the disclaimer of
|
||||||
|
warranties;
|
||||||
|
|
||||||
|
v. a URI or hyperlink to the Licensed Material to the
|
||||||
|
extent reasonably practicable;
|
||||||
|
|
||||||
|
b. indicate if You modified the Licensed Material and
|
||||||
|
retain an indication of any previous modifications; and
|
||||||
|
|
||||||
|
c. indicate the Licensed Material is licensed under this
|
||||||
|
Public License, and include the text of, or the URI or
|
||||||
|
hyperlink to, this Public License.
|
||||||
|
|
||||||
|
2. You may satisfy the conditions in Section 3(a)(1) in any
|
||||||
|
reasonable manner based on the medium, means, and context in
|
||||||
|
which You Share the Licensed Material. For example, it may be
|
||||||
|
reasonable to satisfy the conditions by providing a URI or
|
||||||
|
hyperlink to a resource that includes the required
|
||||||
|
information.
|
||||||
|
|
||||||
|
3. If requested by the Licensor, You must remove any of the
|
||||||
|
information required by Section 3(a)(1)(A) to the extent
|
||||||
|
reasonably practicable.
|
||||||
|
|
||||||
|
4. If You Share Adapted Material You produce, the Adapter's
|
||||||
|
License You apply must not prevent recipients of the Adapted
|
||||||
|
Material from complying with this Public License.
|
||||||
|
|
||||||
|
Section 4 -- Sui Generis Database Rights.
|
||||||
|
|
||||||
|
Where the Licensed Rights include Sui Generis Database Rights that
|
||||||
|
apply to Your use of the Licensed Material:
|
||||||
|
|
||||||
|
a. for the avoidance of doubt, Section 2(a)(1) grants You the right
|
||||||
|
to extract, reuse, reproduce, and Share all or a substantial
|
||||||
|
portion of the contents of the database;
|
||||||
|
|
||||||
|
b. if You include all or a substantial portion of the database
|
||||||
|
contents in a database in which You have Sui Generis Database
|
||||||
|
Rights, then the database in which You have Sui Generis Database
|
||||||
|
Rights (but not its individual contents) is Adapted Material; and
|
||||||
|
|
||||||
|
c. You must comply with the conditions in Section 3(a) if You Share
|
||||||
|
all or a substantial portion of the contents of the database.
|
||||||
|
|
||||||
|
For the avoidance of doubt, this Section 4 supplements and does not
|
||||||
|
replace Your obligations under this Public License where the Licensed
|
||||||
|
Rights include other Copyright and Similar Rights.
|
||||||
|
|
||||||
|
Section 5 -- Disclaimer of Warranties and Limitation of Liability.
|
||||||
|
|
||||||
|
a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE
|
||||||
|
EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS
|
||||||
|
AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
|
||||||
|
ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS,
|
||||||
|
IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION,
|
||||||
|
WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
||||||
|
PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS,
|
||||||
|
ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT
|
||||||
|
KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT
|
||||||
|
ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
|
b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE
|
||||||
|
TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION,
|
||||||
|
NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT,
|
||||||
|
INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES,
|
||||||
|
COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR
|
||||||
|
USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN
|
||||||
|
ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR
|
||||||
|
DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR
|
||||||
|
IN PART, THIS LIMITATION MAY NOT APPLY TO YOU.
|
||||||
|
|
||||||
|
c. The disclaimer of warranties and limitation of liability provided
|
||||||
|
above shall be interpreted in a manner that, to the extent
|
||||||
|
possible, most closely approximates an absolute disclaimer and
|
||||||
|
waiver of all liability.
|
||||||
|
|
||||||
|
Section 6 -- Term and Termination.
|
||||||
|
|
||||||
|
a. This Public License applies for the term of the Copyright and
|
||||||
|
Similar Rights licensed here. However, if You fail to comply with
|
||||||
|
this Public License, then Your rights under this Public License
|
||||||
|
terminate automatically.
|
||||||
|
|
||||||
|
b. Where Your right to use the Licensed Material has terminated under
|
||||||
|
Section 6(a), it reinstates:
|
||||||
|
|
||||||
|
1. automatically as of the date the violation is cured, provided
|
||||||
|
it is cured within 30 days of Your discovery of the
|
||||||
|
violation; or
|
||||||
|
|
||||||
|
2. upon express reinstatement by the Licensor.
|
||||||
|
|
||||||
|
For the avoidance of doubt, this Section 6(b) does not affect any
|
||||||
|
right the Licensor may have to seek remedies for Your violations
|
||||||
|
of this Public License.
|
||||||
|
|
||||||
|
c. For the avoidance of doubt, the Licensor may also offer the
|
||||||
|
Licensed Material under separate terms or conditions or stop
|
||||||
|
distributing the Licensed Material at any time; however, doing so
|
||||||
|
will not terminate this Public License.
|
||||||
|
|
||||||
|
d. Sections 1, 5, 6, 7, and 8 survive termination of this Public
|
||||||
|
License.
|
||||||
|
|
||||||
|
Section 7 -- Other Terms and Conditions.
|
||||||
|
|
||||||
|
a. The Licensor shall not be bound by any additional or different
|
||||||
|
terms or conditions communicated by You unless expressly agreed.
|
||||||
|
|
||||||
|
b. Any arrangements, understandings, or agreements regarding the
|
||||||
|
Licensed Material not stated herein are separate from and
|
||||||
|
independent of the terms and conditions of this Public License.
|
||||||
|
|
||||||
|
Section 8 -- Interpretation.
|
||||||
|
|
||||||
|
a. For the avoidance of doubt, this Public License does not, and
|
||||||
|
shall not be interpreted to, reduce, limit, restrict, or impose
|
||||||
|
conditions on any use of the Licensed Material that could lawfully
|
||||||
|
be made without permission under this Public License.
|
||||||
|
|
||||||
|
b. To the extent possible, if any provision of this Public License is
|
||||||
|
deemed unenforceable, it shall be automatically reformed to the
|
||||||
|
minimum extent necessary to make it enforceable. If the provision
|
||||||
|
cannot be reformed, it shall be severed from this Public License
|
||||||
|
without affecting the enforceability of the remaining terms and
|
||||||
|
conditions.
|
||||||
|
|
||||||
|
c. No term or condition of this Public License will be waived and no
|
||||||
|
failure to comply consented to unless expressly agreed to by the
|
||||||
|
Licensor.
|
||||||
|
|
||||||
|
d. Nothing in this Public License constitutes or may be interpreted
|
||||||
|
as a limitation upon, or waiver of, any privileges and immunities
|
||||||
|
that apply to the Licensor or You, including from the legal
|
||||||
|
processes of any jurisdiction or authority.
|
||||||
|
|
||||||
|
=======================================================================
|
||||||
|
|
||||||
|
Creative Commons is not a party to its public licenses.
|
||||||
|
Notwithstanding, Creative Commons may elect to apply one of its public
|
||||||
|
licenses to material it publishes and in those instances will be
|
||||||
|
considered the "Licensor." Except for the limited purpose of indicating
|
||||||
|
that material is shared under a Creative Commons public license or as
|
||||||
|
otherwise permitted by the Creative Commons policies published at
|
||||||
|
creativecommons.org/policies, Creative Commons does not authorize the
|
||||||
|
use of the trademark "Creative Commons" or any other trademark or logo
|
||||||
|
of Creative Commons without its prior written consent including,
|
||||||
|
without limitation, in connection with any unauthorized modifications
|
||||||
|
to any of its public licenses or any other arrangements,
|
||||||
|
understandings, or agreements concerning use of licensed material. For
|
||||||
|
the avoidance of doubt, this paragraph does not form part of the public
|
||||||
|
licenses.
|
||||||
|
|
||||||
|
Creative Commons may be contacted at creativecommons.org.
|
||||||
|
|
80
docs/README.md
Normal file
@@ -0,0 +1,80 @@
|
|||||||
|
## User Documentation for Yoga
|
||||||
|
|
||||||
|
This directory will contain the user, feature and API documentation for Yoga. The documentation will be hosted on GitHub pages.
|
||||||
|
|
||||||
|
### Contributing
|
||||||
|
|
||||||
|
See [CONTRIBUTING.md](./CONTRIBUTING.md) for details on how to add or modify content.
|
||||||
|
|
||||||
|
### Run the Site Locally
|
||||||
|
|
||||||
|
The requirements for running a GitHub pages site locally is described in [GitHub help](https://help.github.com/articles/setting-up-your-github-pages-site-locally-with-jekyll/#requirements). The steps below summarize these steps.
|
||||||
|
|
||||||
|
> If you have run the site before, you can start with step 1 and then move on to step 5.
|
||||||
|
|
||||||
|
1. Ensure that you are in the same directory where this `README.md` exists (e.g., it could be in `yoga/docs` on `master`, in the root of a `gh-pages` branch, etc). The below RubyGems commands, etc. must be run from there.
|
||||||
|
|
||||||
|
1. Make sure you have Ruby and [RubyGems](https://rubygems.org/) installed.
|
||||||
|
|
||||||
|
> Ruby >= 2.2 is required for the gems. On the latest versions of Mac OS X, Ruby 2.0 is the
|
||||||
|
> default. Use [Homebrew](http://brew.sh) and the `brew install ruby` command (or your
|
||||||
|
> preferred upgrade mechanism) to install a newer version of Ruby for your Mac OS X system.
|
||||||
|
|
||||||
|
1. Make sure you have [Bundler](http://bundler.io/) installed.
|
||||||
|
|
||||||
|
```
|
||||||
|
# may require sudo
|
||||||
|
gem install bundler
|
||||||
|
```
|
||||||
|
1. Install the project's dependencies
|
||||||
|
|
||||||
|
```
|
||||||
|
# run this in the 'docs' directory
|
||||||
|
bundle install
|
||||||
|
```
|
||||||
|
|
||||||
|
> If you get an error when installing `nokogiri`, you may be running into the problem described
|
||||||
|
> in [this nokogiri issue](https://github.com/sparklemotion/nokogiri/issues/1483). You can
|
||||||
|
> either `brew uninstall xz` (and then `brew install xz` after the bundle is installed) or
|
||||||
|
> `xcode-select --install` (although this may not work if you have already installed command
|
||||||
|
> line tools).
|
||||||
|
|
||||||
|
1. Run Jekyll's server.
|
||||||
|
|
||||||
|
- On first runs or for structural changes to the documentation (e.g., new sidebar menu item), do a full build.
|
||||||
|
|
||||||
|
```
|
||||||
|
bundle exec jekyll serve
|
||||||
|
```
|
||||||
|
|
||||||
|
- For content changes only, you can use `--incremental` for faster builds.
|
||||||
|
|
||||||
|
```
|
||||||
|
bundle exec jekyll serve --incremental
|
||||||
|
```
|
||||||
|
|
||||||
|
> We use `bundle exec` instead of running straight `jekyll` because `bundle exec` will always use the version of Jekyll from our `Gemfile`. Just running `jekyll` will use the system version and may not necessarily be compatible.
|
||||||
|
|
||||||
|
- To run using an actual IP address, you can use `--host=0.0.0.0`
|
||||||
|
|
||||||
|
```
|
||||||
|
bundle exec jekyll serve --host=0.0.0.0
|
||||||
|
```
|
||||||
|
|
||||||
|
This will allow you to use the IP address associated with your machine in the URL. That way you could share it with other people.
|
||||||
|
|
||||||
|
e.g., on a Mac, you can your IP address with something like `ifconfig | grep "inet " | grep -v 127.0.0.1`.
|
||||||
|
|
||||||
|
1. Either of commands in the previous step will serve up the site on your local device at http://127.0.0.1:4000/ or http://localhost:4000.
|
||||||
|
|
||||||
|
### Updating the Bundle
|
||||||
|
|
||||||
|
The site depends on Github Pages and the installed bundle is based on the `github-pages` gem.
|
||||||
|
Occasionally that gem might get updated with new or changed functionality. If that is the case,
|
||||||
|
you can run:
|
||||||
|
|
||||||
|
```
|
||||||
|
bundle update
|
||||||
|
```
|
||||||
|
|
||||||
|
to get the latest packages for the installation.
|
17
docs/TEMPLATE-INFORMATION.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
## Template Details
|
||||||
|
|
||||||
|
First, go through `_config.yml` and adjust the available settings to your project's standard. When you make changes here, you'll have to kill the `jekyll serve` instance and restart it to see those changes, but that's only the case with the config file.
|
||||||
|
|
||||||
|
Next, update some image assets - you'll want to update `favicon.png`, `logo.svg`, and `og_image.png` (used for Like button stories and Shares on Facbeook) in the `static` folder with your own logos.
|
||||||
|
|
||||||
|
Next, if you're going to have docs on your site, keep the `_docs` and `docs` folders, if not, you can safely remove them (or you can safely leave them and not include them in your navigation - Jekyll renders all of this before a client views the site anyway, so there's no performance hit from just leaving it there for a future expansion).
|
||||||
|
|
||||||
|
Same thing with a blog section, either keep or delete the `_posts` and `blog` folders.
|
||||||
|
|
||||||
|
You can customize your homepage in three parts - the first in the homepage header, which is mostly automatically derived from the elements you insert into your config file. However, you can also specify a series of 'promotional' elements in `_data/promo.yml`. You can read that file for more information.
|
||||||
|
|
||||||
|
The second place for your homepage is in `index.md` which contains the bulk of the main content below the header. This is all markdown if you want, but you can use HTML and Jekyll's template tags (called Liquid) in there too. Checkout this folder's index.md for an example of one common template tag that we use on our sites called gridblocks.
|
||||||
|
|
||||||
|
The third and last place is in the `_data/powered_by.yml` and `_data/powered_by_highlight.yml` files. Both these files combine to create a section on the homepage that is intended to show a list of companies or apps that are using your project. The `powered_by_highlight` file is a list of curated companies/apps that you want to show as a highlight at the top of this section, including their logos in whatever format you want. The `powered_by` file is a more open list that is just text links to the companies/apps and can be updated via Pull Request by the community. If you don't want these sections on your homepage, just empty out both files and leave them blank.
|
||||||
|
|
||||||
|
The last thing you'll want to do is setup your top level navigation bar. You can do this by editing `nav.yml` and keeping the existing title/href/category structure used there. Although the nav is responsive and fairly flexible design-wise, no more than 5 or 6 nav items is recommended.
|
85
docs/_config.yml
Normal file
@@ -0,0 +1,85 @@
|
|||||||
|
# Site settings
|
||||||
|
permalink: /blog/:year/:month/:day/:title.html
|
||||||
|
title: YOGA
|
||||||
|
tagline: A cross-platform layout engine
|
||||||
|
|
||||||
|
fbappid: "1615782811974223"
|
||||||
|
gacode: "UA-12345-6"
|
||||||
|
|
||||||
|
# baseurl determines the subpath of your site. For example if you're using an
|
||||||
|
# organisation.github.io/reponame/ basic site URL, then baseurl would be set
|
||||||
|
# as "/reponame" but leave blank if you have a top-level domain URL as it is
|
||||||
|
# now set to "" by default as discussed in:
|
||||||
|
# http://jekyllrb.com/news/2016/10/06/jekyll-3-3-is-here/
|
||||||
|
baseurl: "/yoga"
|
||||||
|
|
||||||
|
# the base hostname & protocol for your site
|
||||||
|
# If baseurl is set, then the absolute url for your site would be url/baseurl
|
||||||
|
# This was also be set to the right thing automatically for local development
|
||||||
|
# https://github.com/blog/2277-what-s-new-in-github-pages-with-jekyll-3-3
|
||||||
|
# http://jekyllrb.com/news/2016/10/06/jekyll-3-3-is-here/
|
||||||
|
url: "https://facebook.github.io"
|
||||||
|
|
||||||
|
# Note: There are new filters in Jekyll 3.3 to help with absolute and relative urls
|
||||||
|
# absolute_url
|
||||||
|
# relative_url
|
||||||
|
# So you will see these used throughout the Jekyll code in this template.
|
||||||
|
# no more need for | prepend: site.url | prepend: site.baseurl
|
||||||
|
# http://jekyllrb.com/news/2016/10/06/jekyll-3-3-is-here/
|
||||||
|
#https://github.com/blog/2277-what-s-new-in-github-pages-with-jekyll-3-3
|
||||||
|
|
||||||
|
# The GitHub repo for your project
|
||||||
|
ghrepo: "facebook/yoga"
|
||||||
|
|
||||||
|
# Use these color settings to determine your colour scheme for the site.
|
||||||
|
color:
|
||||||
|
# primary should be a vivid color that reflects the project's brand
|
||||||
|
primary: "#97dccf"
|
||||||
|
# secondary should be a subtle light or dark color used on page backgrounds
|
||||||
|
secondary: "#ffffff"
|
||||||
|
# Use the following to specify whether the previous two colours are 'light'
|
||||||
|
# or 'dark' and therefore what colors can be overlaid on them
|
||||||
|
primary-overlay: "light"
|
||||||
|
secondary-overlay: "light"
|
||||||
|
|
||||||
|
#Uncomment this if you want to enable Algolia doc search with your own values
|
||||||
|
searchconfig:
|
||||||
|
apikey: "48f81041f782ed6463719d8d98c94f38"
|
||||||
|
indexname: "yoga"
|
||||||
|
|
||||||
|
# Blog posts are built into Jekyll by default, with the `_posts` directory.
|
||||||
|
# Here you can specify other types of documentation. The names here are `docs`
|
||||||
|
# and `top-level`. This means their content will be in `_docs` and `_top-level`.
|
||||||
|
# The permalink format is also given.
|
||||||
|
# http://ben.balter.com/2015/02/20/jekyll-collections/
|
||||||
|
collections:
|
||||||
|
docs:
|
||||||
|
output: true
|
||||||
|
permalink: /docs/:name/
|
||||||
|
top-level:
|
||||||
|
output: true
|
||||||
|
permalink: :name.html
|
||||||
|
|
||||||
|
# DO NOT ADJUST BELOW THIS LINE UNLESS YOU KNOW WHAT YOU ARE CHANGING
|
||||||
|
|
||||||
|
markdown: kramdown
|
||||||
|
kramdown:
|
||||||
|
input: GFM
|
||||||
|
syntax_highlighter: rouge
|
||||||
|
|
||||||
|
syntax_highlighter_opts:
|
||||||
|
css_class: 'rougeHighlight'
|
||||||
|
span:
|
||||||
|
line_numbers: false
|
||||||
|
block:
|
||||||
|
line_numbers: true
|
||||||
|
start_line: 1
|
||||||
|
|
||||||
|
sass:
|
||||||
|
style: :compressed
|
||||||
|
|
||||||
|
redcarpet:
|
||||||
|
extensions: [with_toc_data]
|
||||||
|
|
||||||
|
# Exclude these from the sites directory
|
||||||
|
exclude: ['README.md', 'TEMPLATE-INFORMATION.md', 'CONTRIBUTING.md', 'Gemfile', 'Gemfile.lock']
|
4
docs/_data/authors.yml
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
exampleauthor:
|
||||||
|
full_name: Example Author
|
||||||
|
fbid: 1234
|
2
docs/_data/features.yml
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
# Add features here if you are using:
|
||||||
|
# {% include content/gridblocks.html data_source=site.data.features align="center" %}
|
10
docs/_data/nav.yml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
- title: Documentation
|
||||||
|
href: docs/
|
||||||
|
category: api
|
||||||
|
|
||||||
|
- title: GitHub
|
||||||
|
href: https://github.com/facebook/yoga
|
||||||
|
category: external
|
||||||
|
|
||||||
|
# Use external for external links not associated with the paths of the current site.
|
||||||
|
# If a category is external, site urls, for example, are not prepended to the href, etc..
|
25
docs/_data/nav_docs.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
- title: Quick Start
|
||||||
|
items:
|
||||||
|
- id: getting-started
|
||||||
|
- id: learn-more
|
||||||
|
- title: Flexbox concepts
|
||||||
|
items:
|
||||||
|
- id: flex-direction
|
||||||
|
- id: justify-content
|
||||||
|
- id: flex-wrap
|
||||||
|
- id: alignment
|
||||||
|
- id: flex
|
||||||
|
- id: absolute-position
|
||||||
|
- id: min-max-dimen
|
||||||
|
- id: margin-padding-border
|
||||||
|
- title: Yoga additions
|
||||||
|
items:
|
||||||
|
- id: aspect-ratio
|
||||||
|
- id: rtl
|
||||||
|
- title: API
|
||||||
|
items:
|
||||||
|
- id: c
|
||||||
|
- id: objc
|
||||||
|
- id: java
|
||||||
|
- id: csharp
|
||||||
|
- id: javascript
|
1
docs/_data/powered_by.yml
Normal file
@@ -0,0 +1 @@
|
|||||||
|
# For non-highlighted projects. See format in powered_by_highlight.yml
|
6
docs/_data/powered_by_highlight.yml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# React Native uses Yoga now. We can add a highlight later when other projects use it.
|
||||||
|
#- title: Who Uses This Project?
|
||||||
|
# items:
|
||||||
|
# - name: React Native
|
||||||
|
# url: https://facebook.github.io/react-native
|
||||||
|
# img: static/images/react-native.png
|
11
docs/_data/promo.yml
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# This file determines the list of promotional elements added to the header of \
|
||||||
|
# your site's homepage.
|
||||||
|
|
||||||
|
- type: plugin_row
|
||||||
|
children:
|
||||||
|
- type: button
|
||||||
|
href: docs/getting-started/
|
||||||
|
text: Get Started
|
||||||
|
- type: button
|
||||||
|
href: docs/learn-more/
|
||||||
|
text: Learn More
|
74
docs/_docs/api/c.md
Normal file
@@ -0,0 +1,74 @@
|
|||||||
|
---
|
||||||
|
docid: c
|
||||||
|
title: C
|
||||||
|
layout: docs
|
||||||
|
permalink: /docs/api/c/
|
||||||
|
---
|
||||||
|
`YGNodeRef` is the main object you will be interfacing with when using Yoga in C. `YGNodeRef` is a pointer to an internal `YGNode` struct.
|
||||||
|
|
||||||
|
### Lifecycle
|
||||||
|
|
||||||
|
The following functions control the lifecycle of a `YGNodeRef`.
|
||||||
|
|
||||||
|
<script src="https://gist.github.com/emilsjolander/99e454d04df4765147f407bde131feca.js"></script>
|
||||||
|
|
||||||
|
- `YGNodeReset` will reset a node to its initial state so it can be re-used without needing to re-allocate a new node.
|
||||||
|
- `YGNodeFreeRecursive` is mostly used for testing and will free not only the node itself but also its children.
|
||||||
|
|
||||||
|
### Children
|
||||||
|
|
||||||
|
The following functions help manage the children of a node.
|
||||||
|
|
||||||
|
<script src="https://gist.github.com/emilsjolander/7e162314294087bb78817c064d345afb.js"></script>
|
||||||
|
|
||||||
|
### Style getters & setters
|
||||||
|
|
||||||
|
The large part of Yoga's API consists of setters and getters for styles. These all follow the same general structure. Bellow are the function and enums used to control the various styles. For an in depth guide to how each style works see the getting started guide.
|
||||||
|
|
||||||
|
<script src="https://gist.github.com/emilsjolander/74913a3326d952ff5a65dabe5ce4baf8.js"></script>
|
||||||
|
|
||||||
|
### Layout results
|
||||||
|
|
||||||
|
Once you have set up a tree of nodes with styles you will want to get the result of a layout calculation. Call `YGNodeCalculateLayout` with the desired width and height or `YGUndefined` to perform the layout calculation. Once this function returns the results of the layout calculation is stored on each node. Traverse the tree and retrieve the values from each node.
|
||||||
|
|
||||||
|
<script src="https://gist.github.com/emilsjolander/7c7c9c61b69daff5b925719065fb0dc9.js"></script>
|
||||||
|
|
||||||
|
### Custom measurements
|
||||||
|
|
||||||
|
Certain nodes need to ability to measure themselves, the most common example is nodes which represent text. Text has an intrinsic size and requires measuring itself to determine that size. This is not something Yoga can do as it requires relying on the host system's text rendering engine.
|
||||||
|
|
||||||
|
- Call `YGNodeMarkDirty` if a node with a custom text measurement function needs to be re-measured during the next layout pass.
|
||||||
|
|
||||||
|
> A measure function can only be attached to a leaf node in the hierarchy.
|
||||||
|
|
||||||
|
<script src="https://gist.github.com/emilsjolander/73f9118d8bd27f9cb3744c08f1e53a32.js"></script>
|
||||||
|
|
||||||
|
### Context
|
||||||
|
|
||||||
|
Context is important when integrating Yoga into another layout system. Context allows you to associate another object with a `YGNodeRef`. This context can then be retrieved from a `YGNodeRef` when for example its measure function is called. This is what enables Yoga to rely on the Android and iOS system implementations of text measurement in React Native.
|
||||||
|
|
||||||
|
<script src="https://gist.github.com/emilsjolander/c3d23a1b880d59627e959f3447a9511b.js"></script>
|
||||||
|
|
||||||
|
### Logging
|
||||||
|
|
||||||
|
Yoga will by default log to stdout and stderr. You may however customize this to instead log to your own logger.
|
||||||
|
|
||||||
|
<script src="https://gist.github.com/emilsjolander/b538718ffd7a55efc80845468e0f063e.js"></script>
|
||||||
|
|
||||||
|
### Experiments
|
||||||
|
|
||||||
|
Yoga has the concept of experiments. An experiment is a feature which is not yet stable. To enable a feature use the following functions. Once a feature has been tested and is ready to be released as a stable API we will remove its feature flag.
|
||||||
|
|
||||||
|
<script src="https://gist.github.com/emilsjolander/002516a55e10947e4bdcf5484eee8745.js"></script>
|
||||||
|
|
||||||
|
### Custom allocators
|
||||||
|
|
||||||
|
You may want to swap out the allocator used in Yoga. These functions allow that.
|
||||||
|
|
||||||
|
<script src="https://gist.github.com/emilsjolander/f45053d4f09a9faaf94a8fc071f0224f.js"></script>
|
||||||
|
|
||||||
|
### Printing
|
||||||
|
|
||||||
|
Yoga has some hooks to print debug information while calculating layout. With the printing APIs you can add additional information to a node when it is printed.
|
||||||
|
|
||||||
|
<script src="https://gist.github.com/emilsjolander/c9fbaba914d699ecc91841f4f5515f20.js"></script>
|