From 737f1cc67c4b5a53eca5020ff2ed3ef504e00032 Mon Sep 17 00:00:00 2001 From: Emil Sjolander Date: Thu, 9 Feb 2017 03:16:51 -0800 Subject: [PATCH 1/4] Remove now not needed definition of allow_unsafe_import Summary: not needed any more Reviewed By: bolinfest Differential Revision: D4532533 fbshipit-source-id: 43b4db9a21ae774f7d41187e4e4598e171b7a59c --- YOGA_DEFS | 6 ------ 1 file changed, 6 deletions(-) diff --git a/YOGA_DEFS b/YOGA_DEFS index 288b13be..8d17d58f 100644 --- a/YOGA_DEFS +++ b/YOGA_DEFS @@ -27,9 +27,3 @@ BASE_COMPILER_FLAGS = [ def yoga_dep(dep): return '//' + dep - -class allow_unsafe_import: - def __enter__(self): - pass - def __exit__(self, type, value, traceback): - pass From 3db493665e89e196b836abb5aa7e50604e07f8d3 Mon Sep 17 00:00:00 2001 From: Dustin Shahidehpour Date: Thu, 9 Feb 2017 08:25:00 -0800 Subject: [PATCH 2/4] Bump podspec version. Summary: See commit message. #accept2ship Reviewed By: emilsjolander Differential Revision: D4536570 fbshipit-source-id: 4fc72bd4d9418ea06d24a6ca0cdd6845def30465 --- Yoga.podspec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Yoga.podspec b/Yoga.podspec index f9545a9c..e436ae8a 100644 --- a/Yoga.podspec +++ b/Yoga.podspec @@ -1,6 +1,6 @@ Pod::Spec.new do |spec| spec.name = 'Yoga' - spec.version = '1.0.2' + spec.version = '1.1.0' spec.license = { :type => 'BSD', :file => "LICENSE" } spec.homepage = 'https://facebook.github.io/yoga/' spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/c/' @@ -11,7 +11,7 @@ Pod::Spec.new do |spec| spec.authors = 'Facebook' spec.source = { :git => 'https://github.com/facebook/yoga.git', - :tag => 'v2017.01.27.00', + :tag => 'v2017.02.07.00', } spec.module_name = 'yoga' From ef05404beed344a6161ab20300b34a37fc68cb21 Mon Sep 17 00:00:00 2001 From: Dustin Shahidehpour Date: Thu, 9 Feb 2017 08:32:20 -0800 Subject: [PATCH 3/4] Bump YogaKit podspec. Summary: See commit message. #accept2ship Reviewed By: emilsjolander Differential Revision: D4536585 fbshipit-source-id: 808e39e7a38f470c67459a42686e095d8b5e5fc6 --- YogaKit.podspec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/YogaKit.podspec b/YogaKit.podspec index 830617f7..b43224ca 100644 --- a/YogaKit.podspec +++ b/YogaKit.podspec @@ -1,6 +1,6 @@ podspec = Pod::Spec.new do |spec| spec.name = 'YogaKit' - spec.version = '1.0.3' + spec.version = '1.1.0' spec.license = { :type => 'BSD', :file => "LICENSE" } spec.homepage = 'https://facebook.github.io/yoga/' spec.documentation_url = 'https://facebook.github.io/yoga/docs/api/yogakit/' @@ -11,14 +11,14 @@ podspec = Pod::Spec.new do |spec| spec.authors = 'Facebook' spec.source = { :git => 'https://github.com/facebook/yoga.git', - :tag => 'v2017.01.27.00', + :tag => 'v2017.02.07.00', } spec.platform = :ios spec.ios.deployment_target = '8.0' spec.ios.frameworks = 'UIKit' - spec.dependency 'Yoga', '~> 1.0' + spec.dependency 'Yoga', '~> 1.1' spec.source_files = 'YogaKit/Source/*.{h,m}' spec.public_header_files = 'YogaKit/Source/{YGLayout,UIView+Yoga}.h' spec.private_header_files = 'YogaKit/Source/YGLayout+Private.h' From 5037c2f3650dc5b77dfd1b2e0a6530de55302e6b Mon Sep 17 00:00:00 2001 From: Dustin Shahidehpour Date: Thu, 9 Feb 2017 13:05:38 -0800 Subject: [PATCH 4/4] Preserve the origin of the root view. Summary: Currently, we have an issue in YogaKit where it ignores the preexisting bounds a root view. There are multiple fixes for this, but the easiest one for developer experience is to apply the preexisting bounds of the root view to it's frame after layout calculation. Reviewed By: emilsjolander Differential Revision: D4537173 fbshipit-source-id: ccef8b1c1398ea299b4e5710abe597378347a48d --- YogaKit/Source/YGLayout.m | 11 ++++++----- YogaKit/Tests/YogaKitTests.m | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 5 deletions(-) diff --git a/YogaKit/Source/YGLayout.m b/YogaKit/Source/YGLayout.m index 9c44cc83..80d1a244 100644 --- a/YogaKit/Source/YGLayout.m +++ b/YogaKit/Source/YGLayout.m @@ -222,7 +222,7 @@ YG_PROPERTY(CGFloat, aspectRatio, AspectRatio) - (void)applyLayout { [self calculateLayoutWithSize:self.view.bounds.size]; - YGApplyLayoutToViewHierarchy(self.view); + YGApplyLayoutToViewHierarchy(self.view, YES); } - (CGSize)intrinsicSize @@ -364,7 +364,7 @@ static CGFloat YGRoundPixelValue(CGFloat value) return round(value * scale) / scale; } -static void YGApplyLayoutToViewHierarchy(UIView *view) +static void YGApplyLayoutToViewHierarchy(UIView *view, BOOL preserveOrigin) { NSCAssert([NSThread isMainThread], @"Framesetting should only be done on the main thread."); @@ -385,10 +385,11 @@ static void YGApplyLayoutToViewHierarchy(UIView *view) topLeft.y + YGNodeLayoutGetHeight(node), }; + const CGPoint origin = preserveOrigin ? view.frame.origin : CGPointZero; view.frame = (CGRect) { .origin = { - .x = YGRoundPixelValue(topLeft.x), - .y = YGRoundPixelValue(topLeft.y), + .x = YGRoundPixelValue(topLeft.x + origin.x), + .y = YGRoundPixelValue(topLeft.y + origin.y), }, .size = { .width = YGRoundPixelValue(bottomRight.x) - YGRoundPixelValue(topLeft.x), @@ -398,7 +399,7 @@ static void YGApplyLayoutToViewHierarchy(UIView *view) if (!yoga.isLeaf) { for (NSUInteger i=0; i