Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1811 X-link: https://github.com/facebook/react-native/pull/51298 ## Resubmit This was backed out due to being up the stack from another change that was backed out, but should be safe by itself. ## Original We want to know if an artifact created during measurement can fully be reused after final layout, but the final layout is allowed to be slightly larger due to pixel grid rounding (while still allowing reuse). It's hard to tell after the fact, whether it is larger because of this rounding (though the measure is used), or if it may be a pixel larger for valid reasons. We can expose the unsnapped dimensions of a node to give us this information, and to correlate measurement artifacts. This is most of the time the same as the layout's measured dimension, though I don't think it's safe to use this, since anything else measuring the node after could clobber this (I think `YGNodeLayoutGetOverflow` may also be prone to this as a bug). Changelog: [Internal] Reviewed By: joevilches Differential Revision: D74673119 fbshipit-source-id: 06d2eb21e28b76458ec88f4dfcaec809707d0390
46 lines
1.6 KiB
C
46 lines
1.6 KiB
C
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <yoga/YGConfig.h>
|
|
#include <yoga/YGEnums.h>
|
|
#include <yoga/YGMacros.h>
|
|
|
|
YG_EXTERN_C_BEGIN
|
|
|
|
YG_EXPORT float YGNodeLayoutGetLeft(YGNodeConstRef node);
|
|
YG_EXPORT float YGNodeLayoutGetTop(YGNodeConstRef node);
|
|
YG_EXPORT float YGNodeLayoutGetRight(YGNodeConstRef node);
|
|
YG_EXPORT float YGNodeLayoutGetBottom(YGNodeConstRef node);
|
|
YG_EXPORT float YGNodeLayoutGetWidth(YGNodeConstRef node);
|
|
YG_EXPORT float YGNodeLayoutGetHeight(YGNodeConstRef node);
|
|
YG_EXPORT YGDirection YGNodeLayoutGetDirection(YGNodeConstRef node);
|
|
YG_EXPORT bool YGNodeLayoutGetHadOverflow(YGNodeConstRef node);
|
|
|
|
// Get the computed values for these nodes after performing layout. If they were
|
|
// set using point values then the returned value will be the same as
|
|
// YGNodeStyleGetXXX. However if they were set using a percentage value then the
|
|
// returned value is the computed value used during layout.
|
|
YG_EXPORT float YGNodeLayoutGetMargin(YGNodeConstRef node, YGEdge edge);
|
|
YG_EXPORT float YGNodeLayoutGetBorder(YGNodeConstRef node, YGEdge edge);
|
|
YG_EXPORT float YGNodeLayoutGetPadding(YGNodeConstRef node, YGEdge edge);
|
|
|
|
/**
|
|
* Return the measured height of the node, before layout rounding
|
|
*/
|
|
YG_EXPORT float YGNodeLayoutGetRawHeight(YGNodeConstRef node);
|
|
|
|
/**
|
|
* Return the measured width of the node, before layout rounding
|
|
*/
|
|
YG_EXPORT float YGNodeLayoutGetRawWidth(YGNodeConstRef node);
|
|
|
|
YG_EXTERN_C_END
|