summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/java/mupdf_native.c11
-rw-r--r--source/pdf/pdf-annot-edit.c2
-rw-r--r--source/tools/murun.c5
3 files changed, 10 insertions, 8 deletions
diff --git a/platform/java/mupdf_native.c b/platform/java/mupdf_native.c
index ccc50fad..1845f4b9 100644
--- a/platform/java/mupdf_native.c
+++ b/platform/java/mupdf_native.c
@@ -8447,7 +8447,7 @@ FUN(PDFAnnotation_getInkList)(JNIEnv *env, jobject self)
if (!ctx || !annot) return NULL;
fz_try(ctx)
- n = pdf_annot_quad_point_count(ctx, annot);
+ n = pdf_annot_ink_list_count(ctx, annot);
fz_catch(ctx)
{
jni_rethrow(env, ctx);
@@ -8467,7 +8467,7 @@ FUN(PDFAnnotation_getInkList)(JNIEnv *env, jobject self)
return NULL;
}
- jpath = (*env)->NewFloatArray(env, m);
+ jpath = (*env)->NewFloatArray(env, m * 2);
if (!jpath) return NULL;
for (k = 0; k < m; k++)
@@ -8480,7 +8480,7 @@ FUN(PDFAnnotation_getInkList)(JNIEnv *env, jobject self)
return NULL;
}
- (*env)->SetFloatArrayRegion(env, jpath, 0, 2, &v[0]);
+ (*env)->SetFloatArrayRegion(env, jpath, k * 2, 2, &v[0]);
if ((*env)->ExceptionCheck(env)) return NULL;
}
@@ -8545,14 +8545,15 @@ FUN(PDFAnnotation_setInkList)(JNIEnv *env, jobject self, jobject jinklist)
if (!jpath)
continue;
- counts[i] = (*env)->GetArrayLength(env, jpath) / 2;
- (*env)->GetFloatArrayRegion(env, jpath, k, counts[i], points);
+ counts[i] = (*env)->GetArrayLength(env, jpath);
+ (*env)->GetFloatArrayRegion(env, jpath, 0, counts[i], &points[k]);
if ((*env)->ExceptionCheck(env))
{
fz_free(ctx, counts);
fz_free(ctx, points);
return;
}
+ counts[i] /= 2;
(*env)->DeleteLocalRef(env, jpath);
}
diff --git a/source/pdf/pdf-annot-edit.c b/source/pdf/pdf-annot-edit.c
index ee3b1964..dbca68c6 100644
--- a/source/pdf/pdf-annot-edit.c
+++ b/source/pdf/pdf-annot-edit.c
@@ -743,7 +743,7 @@ pdf_annot_ink_list_stroke_count(fz_context *ctx, pdf_annot *annot, int i)
check_allowed_subtypes(ctx, annot, PDF_NAME_InkList, ink_list_subtypes);
ink_list = pdf_dict_get(ctx, annot->obj, PDF_NAME_InkList);
stroke = pdf_array_get(ctx, ink_list, i);
- return pdf_array_len(ctx, stroke);
+ return pdf_array_len(ctx, stroke) / 2;
}
void
diff --git a/source/tools/murun.c b/source/tools/murun.c
index 6754b32e..2e407c99 100644
--- a/source/tools/murun.c
+++ b/source/tools/murun.c
@@ -4158,7 +4158,7 @@ static void ffi_PDFAnnotation_getInkList(js_State *J)
fz_catch(ctx)
rethrow(J);
- for (i = 0; i < n; ++n) {
+ for (i = 0; i < n; ++i) {
fz_try(ctx)
m = pdf_annot_ink_list_stroke_count(ctx, annot, i);
fz_catch(ctx)
@@ -4171,8 +4171,9 @@ static void ffi_PDFAnnotation_getInkList(js_State *J)
fz_catch(ctx)
rethrow(J);
js_pushnumber(J, v[0]);
+ js_setindex(J, -2, k * 2 + 0);
js_pushnumber(J, v[1]);
- js_setindex(J, -2, k);
+ js_setindex(J, -2, k * 2 + 1);
}
js_setindex(J, -2, i);
}