Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bugfix] rm duplication process dimension #902

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
15 changes: 4 additions & 11 deletions yoga/Yoga.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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);
Expand Down