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

Commit

Permalink
layout引擎Frame计算修改为向上取整
Browse files Browse the repository at this point in the history
  • Loading branch information
Txink committed Aug 12, 2019
1 parent 1ee8c74 commit 4b69035
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions ios/sdk/WeexSDK/Sources/Bridge/WXCoreBridge.mm
Original file line number Diff line number Diff line change
Expand Up @@ -646,10 +646,10 @@ static void MergeBorderWidthValues(NSMutableDictionary* dict,
if (!manager.isValid) {
return -1;
}
CGRect frame = CGRectMake(isnan(WXRoundPixelValue(left))?0:WXRoundPixelValue(left),
isnan(WXRoundPixelValue(top))?0:WXRoundPixelValue(top),
isnan(WXRoundPixelValue(width))?0:WXRoundPixelValue(width),
isnan(WXRoundPixelValue(height))?0:WXRoundPixelValue(height));
CGRect frame = CGRectMake(isnan(WXCeilPixelValue(left))?0:WXCeilPixelValue(left),
isnan(WXCeilPixelValue(top))?0:WXCeilPixelValue(top),
isnan(WXCeilPixelValue(width))?0:WXCeilPixelValue(width),
isnan(WXCeilPixelValue(height))?0:WXCeilPixelValue(height));
[manager layoutComponent:component frame:frame isRTL:isRTL innerMainSize:renderObject->getLargestMainSize()];

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

0 comments on commit 4b69035

Please sign in to comment.