-
Notifications
You must be signed in to change notification settings - Fork 24.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Missing moving pieces of RCTSurfaceHostingView
Summary: Now it actually works. Reviewed By: mmmulani Differential Revision: D6701105 fbshipit-source-id: 16f3f4e319f874f9a08867b784d13aad4fa22aeb
- Loading branch information
1 parent
7d9e902
commit 06ebaf2
Showing
4 changed files
with
88 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
React/Base/Surface/SurfaceHostingView/RCTSurfaceSizeMeasureMode.mm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
/** | ||
* Copyright (c) 2015-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. | ||
*/ | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
#import "RCTSurfaceSizeMeasureMode.h" | ||
|
||
void RCTSurfaceMinimumSizeAndMaximumSizeFromSizeAndSizeMeasureMode( | ||
CGSize size, | ||
RCTSurfaceSizeMeasureMode sizeMeasureMode, | ||
CGSize &minimumSize, | ||
CGSize &maximumSize | ||
) { | ||
minimumSize = CGSizeZero; | ||
maximumSize = CGSizeMake(CGFLOAT_MAX, CGFLOAT_MAX); | ||
|
||
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthExact) { | ||
minimumSize.width = size.width; | ||
maximumSize.width = size.width; | ||
} | ||
else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeWidthAtMost) { | ||
maximumSize.width = size.width; | ||
} | ||
|
||
if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightExact) { | ||
minimumSize.height = size.height; | ||
maximumSize.height = size.height; | ||
} | ||
else if (sizeMeasureMode & RCTSurfaceSizeMeasureModeHeightAtMost) { | ||
maximumSize.height = size.height; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters