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 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' 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' 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