Summary: We've mistakenly used `free()` to free the memory, where `delete` should have been used
Reviewed By: davidaurelio
Differential Revision: D9042347
fbshipit-source-id: e15cec0f498409066521a6de1e3fe4b7404ec46c
Summary:
@public
It's very useful sometimes for product code to compare `YGValue`s (e.g. in Fabric).
Reviewed By: priteshrnandgaonkar
Differential Revision: D8937594
fbshipit-source-id: b93e1ab4a6419ada6746f233b587e8c9cb32c6d4
Summary:
@public
Replacing the `YG_NODE_STYLE_PROPERTY_IMPL` macro with template code, in order to make code easier to edit and grep.
Reviewed By: astreet
Differential Revision: D8868184
fbshipit-source-id: f52537376fa8d4dd53aa98bb43e93279699dbdd5
Summary:
@public
Inlines macros used for declarations of `YGNodeStyle*` and `YGNodeLayout*` functions.
Benefits easier grepping and code base navigation.
Reviewed By: astreet
Differential Revision: D8868168
fbshipit-source-id: d6b1b70981a59a2214dc7d166435a1d1a844e1b7
Summary: No need to type out the old version. This is exactly equivalent (unless I've misread and the old version did something other than memberwise copy).
Reviewed By: davidaurelio
Differential Revision: D8842326
fbshipit-source-id: c575ea4cee6caef9ea15aaf5967597385ed26ec3
Summary: It doesn't seem to be used internally, it hurts greppability, and there are setters for these properties as needed anyway.
Reviewed By: davidaurelio
Differential Revision: D8842084
fbshipit-source-id: f0275b490e585ea94df341c97c34b441ed91c4fb
Summary: Holding floats by reference is unnecessary at best and may be detrimental to performance.
Reviewed By: davidaurelio
Differential Revision: D8826496
fbshipit-source-id: 2391f8aa26ebfbb440f6e4b7d57975be688f791c
Summary: I missed these two things: inline default ctor, getValue() should return a float.
Reviewed By: priteshrnandgaonkar
Differential Revision: D8826640
fbshipit-source-id: e6324dea0268ef276e6fa1722e72dffb5241e676
Summary:
It's wasteful to do it by value. I'm fairly sure this is
safe, especially because
fbd332dee8 (diff-ade2a4bbd6582e2898cbd9e0fa142ab5R215)
shows that we did access by reference before.
Reviewed By: priteshrnandgaonkar, davidaurelio
Differential Revision: D8822697
fbshipit-source-id: 791bcf0fa37453f67795af727c85c8adce3b0f69
Summary: Just some convention/weird style things. `float` should be passed by value, weird use of ?: operator instead of ||.
Reviewed By: priteshrnandgaonkar
Differential Revision: D8804407
fbshipit-source-id: e0d67363ccde36ec5bccec7497ed0ffd364b3fcf
Summary: This linked list was never used, and YGNodeDeepClone was doing scary things to maintain it.
Reviewed By: davidaurelio
Differential Revision: D8792864
fbshipit-source-id: c578fabe65c837f0791aa9ac3e18f31d93691abd
Summary:
Fixes the improper `singleFlexChild` optimization. In the case when all the childs have `flex-grow:0 flex-grow:0` except one child with `flex-grow:1 flex-shrink:1`, then one can simply measure all the non-flexing children and then give the flexing child all the remaining space.
Also added a test case which reproduced the bug
Reviewed By: IanChilds
Differential Revision: D8782684
fbshipit-source-id: ffd4d35b6122f82111b987540efb23bd2a8da5a2
Summary:
This diff refactors the cloning mechanism for YogaNode used from Fabric UI renderer and RN iOS graphs.
Previously, we were cleaning the owner of the child's cloned node inside the C++ implementation of YogaNode. This was a mistake because this modified the last commited YogaTree, causing side effect in RN iOS graphs.
Reviewed By: shergin
Differential Revision: D8672627
fbshipit-source-id: c9902d00690e0361fd58aed84b506c42258bd995
Summary: This diff cleans up the parent / owner references for children of ReactShadowNode / YogaNode during cloning. The reason of this behavior is to avoid retaining every generation of trees during cloning. This fixes a memory leak detected when running the ProgressBarExample.android.js in catalyst app
Reviewed By: fkgozali
Differential Revision: D8019894
fbshipit-source-id: b0d38f0c836ffec534f64fa1adbd7511ecf3473d
Summary:
I'm not totally sure what I'm doing so if this needs changes let me know.
Closes https://github.com/facebook/yoga/pull/775
Reviewed By: emilsjolander
Differential Revision: D8331892
Pulled By: passy
fbshipit-source-id: eb1023e666322d2472e4081fd4a4e72a7b43d049
Summary: A few more places to update to target iOS 9.0 (upgraded from 8.0)
Reviewed By: shergin
Differential Revision: D8108719
fbshipit-source-id: f17aa5e5aa34fdad57196202bf67a842735d4cdc
Summary:
This PR fixes the compilation on MSVC. I moved the `YGConfig` creation to a C++ constructor.
Addionally it removes the "dot" notation on `YGValue`, I didn't want to change that type to a C++ constructor, because I think this will break the ABI.
Closes https://github.com/facebook/yoga/pull/746
Differential Revision: D7498141
Pulled By: emilsjolander
fbshipit-source-id: 5f5308ff838dcd803065785ddc08b2404524acb9
Summary:
This PR fixes a type mismatch on `endOfLineIndex` where it should be of type `uint32_t` while it is of type `float`
Additonally it fixes some `double` casting in the rounding methods.
Closes https://github.com/facebook/yoga/pull/745
Differential Revision: D7494519
Pulled By: emilsjolander
fbshipit-source-id: 30a86574ce163458a6888f61a902d0640c1874fb