Breaking: Fix callback const-correctness (#1369)
Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1369 X-link: https://github.com/facebook/react-native/pull/39370 This fixes const-correctness of callbacks (e.g. not letting a logger function modify nodes during layout). This helps us to continue to fix const-correctness issues inside of Yoga. This change is breaking to the public API, since it requires a change in signature passed to Yoga. Changelog: [Internal] Reviewed By: rshest Differential Revision: D49130714 fbshipit-source-id: 4305f8882d89f296e45b78497a51716a0dbb3b2d
This commit is contained in:
committed by
Facebook GitHub Bot
parent
b12a6a340c
commit
26f2b28eca
@@ -38,10 +38,17 @@ struct NodeFlags {
|
||||
|
||||
class YOGA_EXPORT Node : public ::YGNode {
|
||||
public:
|
||||
using MeasureWithContextFn =
|
||||
YGSize (*)(YGNode*, float, YGMeasureMode, float, YGMeasureMode, void*);
|
||||
using BaselineWithContextFn = float (*)(YGNode*, float, float, void*);
|
||||
using PrintWithContextFn = void (*)(YGNode*, void*);
|
||||
// Internal variants of callbacks, currently used only by JNI bindings.
|
||||
// TODO: Reconcile this with the public API
|
||||
using MeasureWithContextFn = YGSize (*)(
|
||||
YGNodeConstRef,
|
||||
float,
|
||||
YGMeasureMode,
|
||||
float,
|
||||
YGMeasureMode,
|
||||
void*);
|
||||
using BaselineWithContextFn = float (*)(YGNodeConstRef, float, float, void*);
|
||||
using PrintWithContextFn = void (*)(YGNodeConstRef, void*);
|
||||
|
||||
private:
|
||||
void* context_ = nullptr;
|
||||
|
Reference in New Issue
Block a user