From d3a097de722b4fc39e108e30c5b2f6207bdf4b17 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Tue, 13 Nov 2018 12:10:26 +0100 Subject: js: Use Image.toPixmap arguments. --- source/tools/murun.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/tools/murun.c b/source/tools/murun.c index 36c66978..281d5ec0 100644 --- a/source/tools/murun.c +++ b/source/tools/murun.c @@ -2320,10 +2320,16 @@ static void ffi_Image_toPixmap(js_State *J) { fz_context *ctx = js_getcontext(J); fz_image *image = js_touserdata(J, 0, "fz_image"); + fz_matrix matrix_, *matrix = NULL; fz_pixmap *pixmap = NULL; + if (js_isnumber(J, 1) && js_isnumber(J, 2)) { + matrix_ = fz_scale(js_tonumber(J, 1), js_tonumber(J, 2)); + matrix = &matrix_; + } + fz_try(ctx) - pixmap = fz_get_pixmap_from_image(ctx, image, NULL, NULL, NULL, NULL); + pixmap = fz_get_pixmap_from_image(ctx, image, NULL, matrix, NULL, NULL); fz_catch(ctx) rethrow(J); -- cgit v1.2.3