From 19035c90e9107226cc53d91f6722ee331339624a Mon Sep 17 00:00:00 2001 From: liukegang Date: Tue, 11 Jun 2019 21:15:29 +0800 Subject: [PATCH] [bugfix] rm duplication process dimension --- yoga/Yoga.cpp | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/yoga/Yoga.cpp b/yoga/Yoga.cpp index e8a2e51234..0456ff9cd4 100644 --- a/yoga/Yoga.cpp +++ b/yoga/Yoga.cpp @@ -3943,9 +3943,6 @@ static void YGRoundToPixelGrid( const float absoluteNodeLeft = absoluteLeft + nodeLeft; const float absoluteNodeTop = absoluteTop + nodeTop; - const float absoluteNodeRight = absoluteNodeLeft + nodeWidth; - const float absoluteNodeBottom = absoluteNodeTop + nodeHeight; - // If a node has a custom measure function we never want to round down its // size as this could lead to unwanted text truncation. const bool textRounding = node->getNodeType() == YGNodeTypeText; @@ -3970,22 +3967,18 @@ static void YGRoundToPixelGrid( node->setLayoutDimension( YGRoundValueToPixelGrid( - absoluteNodeRight, + nodeWidth, pointScaleFactor, (textRounding && hasFractionalWidth), - (textRounding && !hasFractionalWidth)) - - YGRoundValueToPixelGrid( - absoluteNodeLeft, pointScaleFactor, false, textRounding), + (textRounding && !hasFractionalWidth)), YGDimensionWidth); node->setLayoutDimension( YGRoundValueToPixelGrid( - absoluteNodeBottom, + nodeHeight, pointScaleFactor, (textRounding && hasFractionalHeight), - (textRounding && !hasFractionalHeight)) - - YGRoundValueToPixelGrid( - absoluteNodeTop, pointScaleFactor, false, textRounding), + (textRounding && !hasFractionalHeight)), YGDimensionHeight); const uint32_t childCount = YGNodeGetChildCount(node);