mirror of
https://github.com/status-im/react-native.git
synced 2025-01-27 09:45:04 +00:00
[Views] Change rasterization scale to the main screen's scale
Summary: `view.screen` can be nil if the view has not yet been added to the view hierarchy (e.g. new view), so we should use `[UIScreen mainScreen]` instead. In the future, if we need to support multiple screens, one possible fix is to set the rasterization scale in didMoveToWindow/Superview. For now we have just one screen, though. Closes https://github.com/facebook/react-native/pull/2334 Github Author: James Ide <ide@jameside.com>
This commit is contained in:
parent
261f9434e5
commit
12d5f0d6f4
@ -126,7 +126,7 @@ RCT_REMAP_VIEW_PROPERTY(overflow, clipsToBounds, css_clip_t)
|
||||
RCT_CUSTOM_VIEW_PROPERTY(shouldRasterizeIOS, BOOL, RCTView)
|
||||
{
|
||||
view.layer.shouldRasterize = json ? [RCTConvert BOOL:json] : defaultView.layer.shouldRasterize;
|
||||
view.layer.rasterizationScale = view.layer.shouldRasterize ? view.window.screen.scale : defaultView.layer.rasterizationScale;
|
||||
view.layer.rasterizationScale = view.layer.shouldRasterize ? [UIScreen mainScreen].scale : defaultView.layer.rasterizationScale;
|
||||
}
|
||||
RCT_CUSTOM_VIEW_PROPERTY(transformMatrix, CATransform3D, RCTView)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user