Update YGNodeStyleGetGap to return YGValue #1753
@@ -225,17 +225,17 @@ static void serializeTreeImpl(
|
||||
appendEdges<&YGNodeStyleGetPosition>(
|
||||
j, "position", node, defaultNode.get());
|
||||
|
||||
appendFloatIfNotDefault(
|
||||
appendYGValueIfNotDefault(
|
||||
j["style"],
|
||||
"gap",
|
||||
YGNodeStyleGetGap(node, YGGutterAll),
|
||||
YGNodeStyleGetGap(defaultNode.get(), YGGutterAll));
|
||||
appendFloatIfNotDefault(
|
||||
appendYGValueIfNotDefault(
|
||||
j["style"],
|
||||
"column-gap",
|
||||
YGNodeStyleGetGap(node, YGGutterColumn),
|
||||
YGNodeStyleGetGap(defaultNode.get(), YGGutterColumn));
|
||||
appendFloatIfNotDefault(
|
||||
appendYGValueIfNotDefault(
|
||||
j["style"],
|
||||
"row-gap",
|
||||
YGNodeStyleGetGap(node, YGGutterRow),
|
||||
|
@@ -130,7 +130,7 @@ public class YogaNative {
|
||||
static native void jni_YGNodeStyleSetMaxHeightStretchJNI(long nativePointer);
|
||||
static native float jni_YGNodeStyleGetAspectRatioJNI(long nativePointer);
|
||||
static native void jni_YGNodeStyleSetAspectRatioJNI(long nativePointer, float aspectRatio);
|
||||
static native float jni_YGNodeStyleGetGapJNI(long nativePointer, int gutter);
|
||||
static native long jni_YGNodeStyleGetGapJNI(long nativePointer, int gutter);
|
||||
static native void jni_YGNodeStyleSetGapJNI(long nativePointer, int gutter, float gapLength);
|
||||
static native void jni_YGNodeStyleSetGapPercentJNI(long nativePointer, int gutter, float gapLength);
|
||||
static native void jni_YGNodeSetHasMeasureFuncJNI(long nativePointer, boolean hasMeasureFunc);
|
||||
|
@@ -236,7 +236,7 @@ public abstract class YogaNode implements YogaProps {
|
||||
|
||||
public abstract void setAspectRatio(float aspectRatio);
|
||||
|
||||
public abstract float getGap(YogaGutter gutter);
|
||||
public abstract YogaValue getGap(YogaGutter gutter);
|
||||
|
||||
public abstract void setGap(YogaGutter gutter, float gapLength);
|
||||
|
||||
|
@@ -811,8 +811,8 @@ public abstract class YogaNodeJNIBase extends YogaNode implements Cloneable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getGap(YogaGutter gutter) {
|
||||
return YogaNative.jni_YGNodeStyleGetGapJNI(mNativePointer, gutter.intValue());
|
||||
public YogaValue getGap(YogaGutter gutter) {
|
||||
return valueFromLong(YogaNative.jni_YGNodeStyleGetGapJNI(mNativePointer, gutter.intValue()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@@ -725,13 +725,13 @@ jni_YGNodeCloneJNI(JNIEnv* /*env*/, jobject /*obj*/, jlong nativePointer) {
|
||||
return reinterpret_cast<jlong>(clonedYogaNode);
|
||||
}
|
||||
|
||||
static jfloat jni_YGNodeStyleGetGapJNI(
|
||||
static jlong jni_YGNodeStyleGetGapJNI(
|
||||
JNIEnv* /*env*/,
|
||||
jobject /*obj*/,
|
||||
jlong nativePointer,
|
||||
jint gutter) {
|
||||
return (jfloat)YGNodeStyleGetGap(
|
||||
_jlong2YGNodeRef(nativePointer), static_cast<YGGutter>(gutter));
|
||||
return YogaValue::asJavaLong(YGNodeStyleGetGap(
|
||||
_jlong2YGNodeRef(nativePointer), static_cast<YGGutter>(gutter)));
|
||||
}
|
||||
|
||||
static void jni_YGNodeStyleSetGapJNI(
|
||||
|
@@ -439,8 +439,9 @@ Value Node::getPadding(int edge) const {
|
||||
YGNodeStyleGetPadding(m_node, static_cast<YGEdge>(edge)));
|
||||
}
|
||||
|
||||
float Node::getGap(int gutter) {
|
||||
return YGNodeStyleGetGap(m_node, static_cast<YGGutter>(gutter));
|
||||
Value Node::getGap(int gutter) const {
|
||||
return Value::fromYGValue(
|
||||
YGNodeStyleGetGap(m_node, static_cast<YGGutter>(gutter)));
|
||||
}
|
||||
|
||||
bool Node::isReferenceBaseline() {
|
||||
|
@@ -186,7 +186,7 @@ class Node {
|
||||
|
||||
Value getPadding(int edge) const;
|
||||
|
||||
float getGap(int gutter);
|
||||
Value getGap(int gutter) const;
|
||||
|
||||
int getBoxSizing(void) const;
|
||||
|
||||
|
@@ -293,13 +293,8 @@ void YGNodeStyleSetGapPercent(YGNodeRef node, YGGutter gutter, float percent) {
|
||||
node, scopedEnum(gutter), StyleLength::percent(percent));
|
||||
}
|
||||
|
||||
float YGNodeStyleGetGap(const YGNodeConstRef node, const YGGutter gutter) {
|
||||
auto gapLength = resolveRef(node)->style().gap(scopedEnum(gutter));
|
||||
if (gapLength.isUndefined() || gapLength.isAuto()) {
|
||||
return YGUndefined;
|
||||
}
|
||||
|
||||
return static_cast<YGValue>(gapLength).value;
|
||||
YGValue YGNodeStyleGetGap(const YGNodeConstRef node, const YGGutter gutter) {
|
||||
return (YGValue)resolveRef(node)->style().gap(scopedEnum(gutter));
|
||||
}
|
||||
|
||||
void YGNodeStyleSetAspectRatio(const YGNodeRef node, const float aspectRatio) {
|
||||
|
@@ -96,7 +96,7 @@ YG_EXPORT void
|
||||
YGNodeStyleSetGap(YGNodeRef node, YGGutter gutter, float gapLength);
|
||||
YG_EXPORT void
|
||||
YGNodeStyleSetGapPercent(YGNodeRef node, YGGutter gutter, float gapLength);
|
||||
YG_EXPORT float YGNodeStyleGetGap(YGNodeConstRef node, YGGutter gutter);
|
||||
YG_EXPORT YGValue YGNodeStyleGetGap(YGNodeConstRef node, YGGutter gutter);
|
||||
|
||||
YG_EXPORT void YGNodeStyleSetBoxSizing(YGNodeRef node, YGBoxSizing boxSizing);
|
||||
YG_EXPORT YGBoxSizing YGNodeStyleGetBoxSizing(YGNodeConstRef node);
|
||||
|
Reference in New Issue
Block a user