Permalink
Browse files

'-[RCTSurfaceRootShadowView sizeThatFitsMinimumSize:]' was removed

Summary: Because we already support this for all kinds of shadow views!

Reviewed By: mmmulani

Differential Revision: D6665636

fbshipit-source-id: ceee7e4952ede4bbe54aedde5545587a1d13ea5a
  • Loading branch information...
shergin authored and facebook-github-bot committed Jan 8, 2018
1 parent b2a2519 commit 176a578238566ad857c0911e127669f1ee82107d
@@ -15,6 +15,7 @@
#import "RCTAssert.h"
#import "RCTBridge+Private.h"
#import "RCTBridge.h"
#import "RCTShadowView+Layout.h"
#import "RCTSurfaceDelegate.h"
#import "RCTSurfaceRootShadowView.h"
#import "RCTSurfaceRootShadowViewDelegate.h"
@@ -22,9 +22,6 @@
@property (nonatomic, weak) id<RCTSurfaceRootShadowViewDelegate> delegate;
- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize
maximumSize:(CGSize)maximumSize;
/**
* Layout direction (LTR or RTL) inherited from native environment and
* is using as a base direction value in layout engine.
@@ -76,41 +76,6 @@ - (void)calculateLayoutWithMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)m
return viewsWithNewFrame;
}
- (CGSize)sizeThatFitsMinimumSize:(CGSize)minimumSize
maximumSize:(CGSize)maximumSize
{
// Positive case where requested constraind are aready enforced.
if (CGSizeEqualToSize(minimumSize, _minimumSize) &&
CGSizeEqualToSize(maximumSize, _maximumSize)) {
// We stil need to call `calculateLayoutWithMinimumSize:maximumSize`
// mehtod though.
[self calculateLayoutWithMinimumSize:_minimumSize
maximumSize:_maximumSize];
YGNodeRef yogaNode = self.yogaNode;
return CGSizeMake(YGNodeLayoutGetWidth(yogaNode), YGNodeLayoutGetHeight(yogaNode));
}
// Generic case, where requested constraind are different from enforced.
// Applying given size constraints.
[self calculateLayoutWithMinimumSize:minimumSize
maximumSize:maximumSize];
YGNodeRef yogaNode = self.yogaNode;
CGSize fittingSize =
CGSizeMake(YGNodeLayoutGetWidth(yogaNode), YGNodeLayoutGetHeight(yogaNode));
// Reverting size constraints.
[self calculateLayoutWithMinimumSize:_minimumSize
maximumSize:_maximumSize];
return CGSizeMake(
MAX(minimumSize.width, MIN(maximumSize.width, fittingSize.width)),
MAX(minimumSize.height, MIN(maximumSize.height, fittingSize.height))
);
}
- (void)setMinimumSize:(CGSize)minimumSize maximumSize:(CGSize)maximumSize
{
if (CGSizeEqualToSize(minimumSize, _minimumSize) &&

0 comments on commit 176a578

Please sign in to comment.