mirror of
https://github.com/status-im/react-native.git
synced 2025-01-24 16:29:01 +00:00
Fix const declaration mismatch and double/float mix
Summary: This PR fixes a declaration mismatch for `YGNodeCanUseCachedMeasurement` where the last argument is declared non `const` in `.h` and `const` in `.c`. Additionally it uses explicit `float` for fraction calculation do avoid usage of `double` assignment. Closes https://github.com/facebook/yoga/pull/607 Differential Revision: D5677931 Pulled By: emilsjolander fbshipit-source-id: 502da957089e4439ed956987ff8dec10bd033ba3
This commit is contained in:
parent
9c2caaac3e
commit
95faccb13c
@ -3171,12 +3171,12 @@ float YGRoundValueToPixelGrid(const float value,
|
||||
scaledValue = scaledValue - fractial + 1.0;
|
||||
} else if (forceCeil) {
|
||||
// Next we check if we need to use forced rounding
|
||||
scaledValue = scaledValue - fractial + 1.0;
|
||||
scaledValue = scaledValue - fractial + 1.0f;
|
||||
} else if (forceFloor) {
|
||||
scaledValue = scaledValue - fractial;
|
||||
} else {
|
||||
// Finally we just round the value
|
||||
scaledValue = scaledValue - fractial + (fractial >= 0.5f ? 1.0 : 0);
|
||||
scaledValue = scaledValue - fractial + (fractial >= 0.5f ? 1.0f : 0.0f);
|
||||
}
|
||||
return scaledValue / pointScaleFactor;
|
||||
}
|
||||
|
@ -112,7 +112,7 @@ WIN_EXPORT bool YGNodeCanUseCachedMeasurement(const YGMeasureMode widthMode,
|
||||
const float lastComputedHeight,
|
||||
const float marginRow,
|
||||
const float marginColumn,
|
||||
YGConfigRef config);
|
||||
const YGConfigRef config);
|
||||
|
||||
WIN_EXPORT void YGNodeCopyStyle(const YGNodeRef dstNode, const YGNodeRef srcNode);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user