Skip to content
This repository was archived by the owner on Jun 3, 2021. It is now read-only.

Commit 4b69035

Browse files
committed
layout引擎Frame计算修改为向上取整
1 parent 1ee8c74 commit 4b69035

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -646,10 +646,10 @@ static void MergeBorderWidthValues(NSMutableDictionary* dict,
646646
if (!manager.isValid) {
647647
return -1;
648648
}
649-
CGRect frame = CGRectMake(isnan(WXRoundPixelValue(left))?0:WXRoundPixelValue(left),
650-
isnan(WXRoundPixelValue(top))?0:WXRoundPixelValue(top),
651-
isnan(WXRoundPixelValue(width))?0:WXRoundPixelValue(width),
652-
isnan(WXRoundPixelValue(height))?0:WXRoundPixelValue(height));
649+
CGRect frame = CGRectMake(isnan(WXCeilPixelValue(left))?0:WXCeilPixelValue(left),
650+
isnan(WXCeilPixelValue(top))?0:WXCeilPixelValue(top),
651+
isnan(WXCeilPixelValue(width))?0:WXCeilPixelValue(width),
652+
isnan(WXCeilPixelValue(height))?0:WXCeilPixelValue(height));
653653
[manager layoutComponent:component frame:frame isRTL:isRTL innerMainSize:renderObject->getLargestMainSize()];
654654

655655
page->CallBridgeTime(getCurrentTime() - startTime);
@@ -1551,10 +1551,10 @@ + (void)_traverseTree:(WeexCore::RenderObject *)render index:(int)index pageId:(
15511551
float width = render->getLayoutWidth();
15521552
BOOL isRTL = render->getLayoutDirectionFromPathNode() == WeexCore::kDirectionRTL;
15531553
WXComponentManager* manager = [WXSDKManager instanceForID:ns_instanceId].componentManager;
1554-
CGRect frame = CGRectMake(isnan(WXRoundPixelValue(left))?0:WXRoundPixelValue(left),
1555-
isnan(WXRoundPixelValue(top))?0:WXRoundPixelValue(top),
1556-
isnan(WXRoundPixelValue(width))?0:WXRoundPixelValue(width),
1557-
isnan(WXRoundPixelValue(height))?0:WXRoundPixelValue(height));
1554+
CGRect frame = CGRectMake(isnan(WXCeilPixelValue(left))?0:WXCeilPixelValue(left),
1555+
isnan(WXCeilPixelValue(top))?0:WXCeilPixelValue(top),
1556+
isnan(WXCeilPixelValue(width))?0:WXCeilPixelValue(width),
1557+
isnan(WXCeilPixelValue(height))?0:WXCeilPixelValue(height));
15581558
[manager layoutComponent:component frame:frame isRTL:isRTL innerMainSize:render->getLargestMainSize()];
15591559
}
15601560
render->setHasNewLayout(false);

0 commit comments

Comments
 (0)