mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Delete RCTComputeScreenScale
Summary: This method is redundant. You could just call RCTScreenScale() Changelog: [iOS][Removed] Delete RCTComputeScreenScale Reviewed By: philIip Differential Revision: D72258778 fbshipit-source-id: 0b469169efc4f2def85b2e6b736f3c4570e6b428
This commit is contained in:
committed by
Facebook GitHub Bot
parent
1c21ec21e7
commit
094876367f
@@ -46,9 +46,6 @@ RCT_EXTERN void RCTExecuteOnMainQueue(dispatch_block_t block);
|
||||
// Please do not use this unless you know what you're doing.
|
||||
RCT_EXTERN void RCTUnsafeExecuteOnMainQueueSync(dispatch_block_t block);
|
||||
|
||||
// Get screen scale, can be only used on main
|
||||
RCT_EXTERN void RCTComputeScreenScale(void);
|
||||
|
||||
// Get screen metrics in a thread-safe way
|
||||
RCT_EXTERN CGFloat RCTScreenScale(void);
|
||||
RCT_EXTERN CGFloat RCTFontSizeMultiplier(void);
|
||||
|
||||
@@ -317,18 +317,11 @@ static void RCTUnsafeExecuteOnMainQueueOnceSync(dispatch_once_t *onceToken, disp
|
||||
}
|
||||
}
|
||||
|
||||
static dispatch_once_t onceTokenScreenScale;
|
||||
static CGFloat screenScale;
|
||||
|
||||
void RCTComputeScreenScale(void)
|
||||
{
|
||||
dispatch_once(&onceTokenScreenScale, ^{
|
||||
screenScale = [UITraitCollection currentTraitCollection].displayScale;
|
||||
});
|
||||
}
|
||||
|
||||
CGFloat RCTScreenScale(void)
|
||||
{
|
||||
static dispatch_once_t onceTokenScreenScale;
|
||||
static CGFloat screenScale;
|
||||
|
||||
RCTUnsafeExecuteOnMainQueueOnceSync(&onceTokenScreenScale, ^{
|
||||
screenScale = [UITraitCollection currentTraitCollection].displayScale;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user