Pass parent with down with calculateLayout to allow percentages on root node
Summary: For percentage paddings/margins/sizes to work on the root node we need to have the ability to pass down the parent sizes. This has always been possible with the C API but was never exposed to java. This diff exposes this functionality. Reviewed By: astreet Differential Revision: D4501016 fbshipit-source-id: 0c9502e86ff200c021c78afb7ac4b48cf11b3bdb
This commit is contained in:
committed by
Facebook Github Bot
parent
93e327f4a5
commit
56d06e27cf
@@ -202,11 +202,11 @@ void jni_YGNodeRemoveChild(alias_ref<jobject>, jlong nativePointer, jlong childP
|
||||
YGNodeRemoveChild(_jlong2YGNodeRef(nativePointer), _jlong2YGNodeRef(childPointer));
|
||||
}
|
||||
|
||||
void jni_YGNodeCalculateLayout(alias_ref<jobject>, jlong nativePointer) {
|
||||
void jni_YGNodeCalculateLayout(alias_ref<jobject>, jlong nativePointer, jfloat width, jfloat height) {
|
||||
const YGNodeRef root = _jlong2YGNodeRef(nativePointer);
|
||||
YGNodeCalculateLayout(root,
|
||||
YGUndefined,
|
||||
YGUndefined,
|
||||
static_cast<float>(width),
|
||||
static_cast<float>(height),
|
||||
YGNodeStyleGetDirection(_jlong2YGNodeRef(nativePointer)));
|
||||
YGTransferLayoutOutputsRecursive(root);
|
||||
}
|
||||
|
Reference in New Issue
Block a user