mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fix rounding issue when setting padding
Summary: Changelog: [Internal] Padding needs to be rounded down (floor function), not rounded to the closest natural number. Otherwise the content of the view might not fit. Reviewed By: JoshuaGross Differential Revision: D23905145 fbshipit-source-id: e84d70155b207144b98646dd0c4fea7a8c4bd876
This commit is contained in:
committed by
Facebook GitHub Bot
parent
663b5a878b
commit
d5f7622611
@@ -442,10 +442,10 @@ local_ref<JMountItem::javaobject> createUpdatePaddingMountItem(
|
||||
auto pointScaleFactor = layoutMetrics.pointScaleFactor;
|
||||
auto contentInsets = layoutMetrics.contentInsets;
|
||||
|
||||
int left = round(contentInsets.left * pointScaleFactor);
|
||||
int top = round(contentInsets.top * pointScaleFactor);
|
||||
int right = round(contentInsets.right * pointScaleFactor);
|
||||
int bottom = round(contentInsets.bottom * pointScaleFactor);
|
||||
int left = floor(contentInsets.left * pointScaleFactor);
|
||||
int top = floor(contentInsets.top * pointScaleFactor);
|
||||
int right = floor(contentInsets.right * pointScaleFactor);
|
||||
int bottom = floor(contentInsets.bottom * pointScaleFactor);
|
||||
|
||||
return updatePaddingInstruction(
|
||||
javaUIManager, newChildShadowView.tag, left, top, right, bottom);
|
||||
|
||||
Reference in New Issue
Block a user