From d3e3c894673a72753ba9cea5786ab7fbff78e2e8 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 17 Feb 2014 15:46:52 +0100 Subject: Add fz_transform_point_xy to simplify transforming a point. Many times, the idiom p.x = x; p.y = y; fz_transform_point() is used. This function should simplify that use case by both initializing and transforming the point in one call. --- source/xps/xps-path.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'source/xps') diff --git a/source/xps/xps-path.c b/source/xps/xps-path.c index ea84a815..84ee53f0 100644 --- a/source/xps/xps-path.c +++ b/source/xps/xps-path.c @@ -58,9 +58,7 @@ xps_draw_arc_segment(fz_context *doc, fz_path *path, const fz_matrix *mtx, float { for (t = th0 + d; t < th1 - d/2; t += d) { - p.x = cosf(t); - p.y = sinf(t); - fz_transform_point(&p, mtx); + fz_transform_point_xy(&p, mtx, cosf(t), sinf(t)); fz_lineto(doc, path, p.x, p.y); } } @@ -69,9 +67,7 @@ xps_draw_arc_segment(fz_context *doc, fz_path *path, const fz_matrix *mtx, float th0 += (float)M_PI * 2; for (t = th0 - d; t > th1 + d/2; t -= d) { - p.x = cosf(t); - p.y = sinf(t); - fz_transform_point(&p, mtx); + fz_transform_point_xy(&p, mtx, cosf(t), sinf(t)); fz_lineto(doc, path, p.x, p.y); } } -- cgit v1.2.3