Skip to content

Commit 208d445

Browse files
aguashuimeta-codesync[bot]
authored andcommitted
Kitchen sink changes (#58712)
Summary: X-link: react/yoga#2031 Pull Request resolved: #58712 Disclaimer: Brought by vibing with Gemini. ## Changelog: [Internal] - Typos X-link: react/yoga#2030 Test Plan: N/A - they are only typos fixes Reviewed By: javache Differential Revision: D122122336 Pulled By: cipolleschi fbshipit-source-id: dd22d6adeaff4ec86f873a01bfeb5f38c026a948
1 parent 19a6722 commit 208d445

7 files changed

Lines changed: 29 additions & 28 deletions

File tree

‎packages/react-native/ReactCommon/yoga/yoga/YGConfig.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ YG_EXPORT bool YGConfigGetUseWebDefaults(YGConfigConstRef config);
6161

6262
/**
6363
* Yoga will by default round final layout positions and dimensions to the
64-
* nearst point. `pointScaleFactor` controls the density of the grid used for
64+
* nearest point. `pointScaleFactor` controls the density of the grid used for
6565
* layout rounding (e.g. to round to the closest display pixel).
6666
*
6767
* May be set to 0.0f to avoid rounding the layout results.

‎packages/react-native/ReactCommon/yoga/yoga/YGMacros.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,8 @@
4545

4646
#ifdef NS_ENUM
4747
// Cannot use NSInteger as NSInteger has a different size than int (which is the
48-
// default type of a enum). Therefor when linking the Yoga C library into obj-c
49-
// the header is a mismatch for the Yoga ABI.
48+
// default type of an enum). Therefore when linking the Yoga C library into
49+
// obj-c the header is a mismatch for the Yoga ABI.
5050
#define YG_ENUM_BEGIN(name) NS_ENUM(int, name)
5151
#define YG_ENUM_END(name)
5252
#else

‎packages/react-native/ReactCommon/yoga/yoga/algorithm/AbsoluteLayout.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ bool layoutAbsoluteDescendants(
555555
// which are positioned relative to the current containing block instead
556556
// of their parent. "child" may not be dirty, or have new constraints, so
557557
// absolute positioning may be the first time during this layout pass that
558-
// we need to mutate these descendents. Make sure the path of
558+
// we need to mutate these descendants. Make sure the path of
559559
// nodes to them is mutable before positioning.
560560
child->cloneChildrenIfNeeded();
561561
const Direction childDirection =

‎packages/react-native/ReactCommon/yoga/yoga/algorithm/CalculateLayout.cpp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1263,9 +1263,9 @@ static float distributeFreeSpaceSecondPass(
12631263
return deltaFreeSpace;
12641264
}
12651265

1266-
// It distributes the free space to the flexible items.For those flexible items
1267-
// whose min and max constraints are triggered, those flex item's clamped size
1268-
// is removed from the remaingfreespace.
1266+
// It distributes the free space to the flexible items. For those flexible items
1267+
// whose min and max constraints are triggered, that flex item's clamped size
1268+
// is removed from the remainingFreeSpace.
12691269
static void distributeFreeSpaceFirstPass(
12701270
yoga::Node* const node,
12711271
FlexLine& flexLine,

‎packages/react-native/ReactCommon/yoga/yoga/algorithm/FlexLine.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ struct FlexLine {
5757
};
5858

5959
// Calculates where a line starting at a given index should break, returning
60-
// information about the collective children on the liune.
60+
// information about the collective children on the line.
6161
//
6262
// This function assumes that all the children of node have their
63-
// computedFlexBasis properly computed(To do this use
63+
// computedFlexBasis properly computed (to do this, use the
6464
// computeFlexBasisForChildren function).
6565
FlexLine calculateFlexLine(
6666
yoga::Node* node,

‎packages/react-native/ReactCommon/yoga/yoga/algorithm/PixelGrid.cpp‎

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ float roundValueToPixelGrid(
1818
const bool forceCeil,
1919
const bool forceFloor) {
2020
double scaledValue = value * pointScaleFactor;
21-
// We want to calculate `fractial` such that `floor(scaledValue) = scaledValue
22-
// - fractial`.
23-
double fractial = fmod(scaledValue, 1.0);
24-
if (fractial < 0) {
21+
// We want to calculate `fractional` such that `floor(scaledValue) =
22+
// scaledValue
23+
// - fractional`.
24+
double fractional = fmod(scaledValue, 1.0);
25+
if (fractional < 0) {
2526
// This branch is for handling negative numbers for `value`.
2627
//
2728
// Regarding `floor` and `ceil`. Note that for a number x, `floor(x) <= x <=
@@ -31,29 +32,29 @@ float roundValueToPixelGrid(
3132
//
3233
// Regarding `fmodf`. For fractional negative numbers, `fmodf` returns a
3334
// negative number. For example, `fmodf(-2.2) = -0.2`. However, we want
34-
// `fractial` to be the number such that subtracting it from `value` will
35+
// `fractional` to be the number such that subtracting it from `value` will
3536
// give us `floor(value)`. In the case of negative numbers, adding 1 to
3637
// `fmodf(value)` gives us this. Let's continue the example from above:
37-
// - fractial = fmodf(-2.2) = -0.2
38-
// - Add 1 to the fraction: fractial2 = fractial + 1 = -0.2 + 1 = 0.8
39-
// - Finding the `floor`: -2.2 - fractial2 = -2.2 - 0.8 = -3
40-
++fractial;
38+
// - fractional = fmodf(-2.2) = -0.2
39+
// - Add 1 to the fraction: fractional2 = fractional + 1 = -0.2 + 1 = 0.8
40+
// - Finding the `floor`: -2.2 - fractional2 = -2.2 - 0.8 = -3
41+
++fractional;
4142
}
42-
if (yoga::inexactEquals(fractial, 0)) {
43+
if (yoga::inexactEquals(fractional, 0)) {
4344
// First we check if the value is already rounded
44-
scaledValue = scaledValue - fractial;
45-
} else if (yoga::inexactEquals(fractial, 1.0)) {
46-
scaledValue = scaledValue - fractial + 1.0;
45+
scaledValue = scaledValue - fractional;
46+
} else if (yoga::inexactEquals(fractional, 1.0)) {
47+
scaledValue = scaledValue - fractional + 1.0;
4748
} else if (forceCeil) {
4849
// Next we check if we need to use forced rounding
49-
scaledValue = scaledValue - fractial + 1.0;
50+
scaledValue = scaledValue - fractional + 1.0;
5051
} else if (forceFloor) {
51-
scaledValue = scaledValue - fractial;
52+
scaledValue = scaledValue - fractional;
5253
} else {
5354
// Finally we just round the value
54-
scaledValue = scaledValue - fractial +
55-
(!std::isnan(fractial) &&
56-
(fractial > 0.5 || yoga::inexactEquals(fractial, 0.5))
55+
scaledValue = scaledValue - fractional +
56+
(!std::isnan(fractional) &&
57+
(fractional > 0.5 || yoga::inexactEquals(fractional, 0.5))
5758
? 1.0
5859
: 0.0);
5960
}

‎packages/react-native/ReactCommon/yoga/yoga/node/Node.cpp‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -315,7 +315,7 @@ void Node::setPosition(
315315
const Direction direction,
316316
const float ownerWidth,
317317
const float ownerHeight) {
318-
/* Root nodes should be always layouted as LTR, so we don't return negative
318+
/* Root nodes should always be laid out as LTR, so we don't return negative
319319
* values. */
320320
const Direction directionRespectingRoot =
321321
owner_ != nullptr ? direction : Direction::LTR;

0 commit comments

Comments
 (0)