From c4dd67804afc84fde84402649e5b32f2b00680c3 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Mon, 5 Feb 2018 00:06:44 +0000 Subject: fix emiting beziers --- src/page.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/page.c b/src/page.c index 5156430..c5ea8b8 100644 --- a/src/page.c +++ b/src/page.c @@ -276,6 +276,19 @@ render_operation_l(struct content_operation *operation, struct graphics_state *g return NSPDFERROR_OK; } +static inline nspdferror +render_operation_c(struct content_operation *operation, struct graphics_state *gs) +{ + gs->path[gs->path_idx++] = NSPDF_PATH_BEZIER; + gs->path[gs->path_idx++] = operation->u.number[0]; + gs->path[gs->path_idx++] = operation->u.number[1]; + gs->path[gs->path_idx++] = operation->u.number[2]; + gs->path[gs->path_idx++] = operation->u.number[3]; + gs->path[gs->path_idx++] = operation->u.number[4]; + gs->path[gs->path_idx++] = operation->u.number[5]; + return NSPDFERROR_OK; +} + static inline nspdferror render_operation_re(struct content_operation *operation, struct graphics_state *gs) { @@ -485,6 +498,10 @@ nspdf_page_render(struct nspdf_doc *doc, res = render_operation_re(operation, &gs); break; + case CONTENT_OP_c: /* curve */ + res = render_operation_c(operation, &gs); + break; + case CONTENT_OP_h: /* close path */ res = render_operation_h(&gs); break; -- cgit v1.2.3