BREAKING - Make first parameter of measure and print functions CSSNodeRef instead of just context

Summary: To perform some JNI optimizations for java we need a reference to the node in the measure function. This updates the API to provide the whole node as input instead of just the context.

Reviewed By: javache

Differential Revision: D4081544

fbshipit-source-id: d49679025cea027cf7b8482898de0a01fe0f9d40
This commit is contained in:
Emil Sjolander
2016-10-27 10:52:11 -07:00
committed by Facebook Github Bot
parent b59ce09109
commit 46823878a5
10 changed files with 24 additions and 24 deletions

View File

@@ -206,7 +206,7 @@ static void _updateFrameRecursive(UIView *view);
#pragma mark - Private
static CSSSize _measure(
void *context,
CSSNodeRef node,
float width,
CSSMeasureMode widthMode,
float height,
@@ -222,7 +222,7 @@ static CSSSize _measure(
};
}
UIView *view = (__bridge UIView*) context;
UIView *view = (__bridge UIView*) CSSNodeGetContext(node);
const CGSize sizeThatFits = [view sizeThatFits:(CGSize) {
.width = widthMode == CSSMeasureModeUndefined ? CGFLOAT_MAX : width,
.height = heightMode == CSSMeasureModeUndefined ? CGFLOAT_MAX : height,