summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Sanders <vince@kyllikki.org>2018-02-05 00:06:44 +0000
committerVincent Sanders <vince@kyllikki.org>2018-02-05 00:06:44 +0000
commitc4dd67804afc84fde84402649e5b32f2b00680c3 (patch)
tree3032045d1a6f4da180de13cf14b91e46936b95ad
parent4a18ec928fa6e6e2231fcef76e91eb1a4d57f588 (diff)
downloadlibnspdf-c4dd67804afc84fde84402649e5b32f2b00680c3.tar.gz
libnspdf-c4dd67804afc84fde84402649e5b32f2b00680c3.tar.bz2
fix emiting beziers
-rw-r--r--src/page.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/page.c b/src/page.c
index 5156430..c5ea8b8 100644
--- a/src/page.c
+++ b/src/page.c
@@ -277,6 +277,19 @@ render_operation_l(struct content_operation *operation, struct graphics_state *g
}
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)
{
gs->path[gs->path_idx++] = NSPDF_PATH_MOVE;
@@ -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;