Skip to content

Commit 6243253

Browse files
yannicklfacebook-github-bot
authored andcommitted
Revert D74292949: Expose Unsnapped Dimensions
Differential Revision: D74292949 Original commit changeset: 05011c66a9a9 Original Phabricator Diff: D74292949 fbshipit-source-id: c6ca51c7b882950d54b6a43e206973774db40429
1 parent 37a94a8 commit 6243253

File tree

6 files changed

+6
-54
lines changed

6 files changed

+6
-54
lines changed

tests/YGRoundingFunctionTest.cpp

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,23 +161,3 @@ TEST(YogaTest, per_node_point_scale_factor) {
161161
YGConfigFree(config2);
162162
YGConfigFree(config3);
163163
}
164-
165-
TEST(YogaTest, raw_layout_dimensions) {
166-
YGConfigRef config = YGConfigNew();
167-
YGConfigSetPointScaleFactor(config, 0.5f);
168-
169-
YGNodeRef root = YGNodeNewWithConfig(config);
170-
YGNodeStyleSetWidth(root, 11.5f);
171-
YGNodeStyleSetHeight(root, 9.5f);
172-
173-
YGNodeCalculateLayout(root, YGUndefined, YGUndefined, YGDirectionLTR);
174-
175-
ASSERT_EQ(YGNodeLayoutGetWidth(root), 12.0f);
176-
ASSERT_EQ(YGNodeLayoutGetHeight(root), 10.0f);
177-
ASSERT_EQ(YGNodeLayoutGetRawWidth(root), 11.5f);
178-
ASSERT_EQ(YGNodeLayoutGetRawHeight(root), 9.5f);
179-
180-
YGNodeFreeRecursive(root);
181-
182-
YGConfigFree(config);
183-
}

yoga/YGNodeLayout.cpp

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -90,11 +90,3 @@ float YGNodeLayoutGetPadding(YGNodeConstRef node, YGEdge edge) {
9090
return getResolvedLayoutProperty<&LayoutResults::padding>(
9191
node, scopedEnum(edge));
9292
}
93-
94-
float YGNodeLayoutGetRawHeight(YGNodeConstRef node) {
95-
return resolveRef(node)->getLayout().rawDimension(Dimension::Height);
96-
}
97-
98-
float YGNodeLayoutGetRawWidth(YGNodeConstRef node) {
99-
return resolveRef(node)->getLayout().rawDimension(Dimension::Width);
100-
}

yoga/YGNodeLayout.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -32,14 +32,4 @@ YG_EXPORT float YGNodeLayoutGetMargin(YGNodeConstRef node, YGEdge edge);
3232
YG_EXPORT float YGNodeLayoutGetBorder(YGNodeConstRef node, YGEdge edge);
3333
YG_EXPORT float YGNodeLayoutGetPadding(YGNodeConstRef node, YGEdge edge);
3434

35-
/**
36-
* Return the measured height of the node, before layout rounding
37-
*/
38-
YG_EXPORT float YGNodeLayoutGetRawHeight(YGNodeConstRef node);
39-
40-
/**
41-
* Return the measured width of the node, before layout rounding
42-
*/
43-
YG_EXPORT float YGNodeLayoutGetRawWidth(YGNodeConstRef node);
44-
4535
YG_EXTERN_C_END

yoga/algorithm/PixelGrid.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -106,25 +106,25 @@ void roundLayoutResultsToPixelGrid(
106106
const bool hasFractionalHeight =
107107
!yoga::inexactEquals(round(scaledNodeHeight), scaledNodeHeight);
108108

109-
node->getLayout().setDimension(
110-
Dimension::Width,
109+
node->setLayoutDimension(
111110
roundValueToPixelGrid(
112111
absoluteNodeRight,
113112
pointScaleFactor,
114113
(textRounding && hasFractionalWidth),
115114
(textRounding && !hasFractionalWidth)) -
116115
roundValueToPixelGrid(
117-
absoluteNodeLeft, pointScaleFactor, false, textRounding));
116+
absoluteNodeLeft, pointScaleFactor, false, textRounding),
117+
Dimension::Width);
118118

119-
node->getLayout().setDimension(
120-
Dimension::Height,
119+
node->setLayoutDimension(
121120
roundValueToPixelGrid(
122121
absoluteNodeBottom,
123122
pointScaleFactor,
124123
(textRounding && hasFractionalHeight),
125124
(textRounding && !hasFractionalHeight)) -
126125
roundValueToPixelGrid(
127-
absoluteNodeTop, pointScaleFactor, false, textRounding));
126+
absoluteNodeTop, pointScaleFactor, false, textRounding),
127+
Dimension::Height);
128128
}
129129

130130
for (yoga::Node* child : node->getChildren()) {

yoga/node/LayoutResults.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,10 @@ struct LayoutResults {
6666
return measuredDimensions_[yoga::to_underlying(axis)];
6767
}
6868

69-
float rawDimension(Dimension axis) const {
70-
return rawDimensions_[yoga::to_underlying(axis)];
71-
}
72-
7369
void setMeasuredDimension(Dimension axis, float dimension) {
7470
measuredDimensions_[yoga::to_underlying(axis)] = dimension;
7571
}
7672

77-
void setRawDimension(Dimension axis, float dimension) {
78-
rawDimensions_[yoga::to_underlying(axis)] = dimension;
79-
}
80-
8173
float position(PhysicalEdge physicalEdge) const {
8274
return position_[yoga::to_underlying(physicalEdge)];
8375
}
@@ -121,7 +113,6 @@ struct LayoutResults {
121113

122114
std::array<float, 2> dimensions_ = {{YGUndefined, YGUndefined}};
123115
std::array<float, 2> measuredDimensions_ = {{YGUndefined, YGUndefined}};
124-
std::array<float, 2> rawDimensions_ = {{YGUndefined, YGUndefined}};
125116
std::array<float, 4> position_ = {};
126117
std::array<float, 4> margin_ = {};
127118
std::array<float, 4> border_ = {};

yoga/node/Node.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,6 @@ void Node::setLayoutHadOverflow(bool hadOverflow) {
247247

248248
void Node::setLayoutDimension(float lengthValue, Dimension dimension) {
249249
layout_.setDimension(dimension, lengthValue);
250-
layout_.setRawDimension(dimension, lengthValue);
251250
}
252251

253252
// If both left and right are defined, then use left. Otherwise return +left or

0 commit comments

Comments
 (0)