Skip to content

Commit

Permalink
Update Java binding for YGNodeStyleGetGap to return YGValue
Browse files Browse the repository at this point in the history
  • Loading branch information
heoblitz committed Nov 26, 2024
1 parent 718c54c commit d4b64f8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion java/com/facebook/yoga/YogaNative.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ public class YogaNative {
static native void jni_YGNodeStyleSetMaxHeightPercentJNI(long nativePointer, float percent);
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);
Expand Down
2 changes: 1 addition & 1 deletion java/com/facebook/yoga/YogaNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ public interface Inputs {

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);

Expand Down
4 changes: 2 additions & 2 deletions java/com/facebook/yoga/YogaNodeJNIBase.java
Original file line number Diff line number Diff line change
Expand Up @@ -727,8 +727,8 @@ public void markLayoutSeen() {
}

@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
Expand Down
6 changes: 3 additions & 3 deletions java/jni/YGJNIVanilla.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -703,13 +703,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(
Expand Down

0 comments on commit d4b64f8

Please sign in to comment.