diff options
Diffstat (limited to 'source/svg')
-rw-r--r-- | source/svg/svg-parse.c | 6 | ||||
-rw-r--r-- | source/svg/svg-run.c | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/source/svg/svg-parse.c b/source/svg/svg-parse.c index a400e5a5..51746e6c 100644 --- a/source/svg/svg-parse.c +++ b/source/svg/svg-parse.c @@ -111,7 +111,7 @@ svg_parse_angle(const char *str) return val * 0.9; if (!strcmp(end, "rad")) - return val * 57.2957795; + return val * FZ_RADIAN; return val; } @@ -251,7 +251,7 @@ svg_parse_transform(fz_context *ctx, svg_document *doc, char *str, fz_matrix *tr m.a = 1; m.b = 0; - m.c = tanf(args[0] * 0.0174532925); + m.c = tanf(args[0] * FZ_DEGREE); m.d = 1; m.e = 0; m.f = 0; @@ -267,7 +267,7 @@ svg_parse_transform(fz_context *ctx, svg_document *doc, char *str, fz_matrix *tr fz_throw(ctx, FZ_ERROR_SYNTAX, "wrong number of arguments to skewY(): %d", nargs); m.a = 1; - m.b = tanf(args[0] * 0.0174532925); + m.b = tanf(args[0] * FZ_DEGREE); m.c = 0; m.d = 1; m.e = 0; diff --git a/source/svg/svg-run.c b/source/svg/svg-run.c index d113fd13..eead3b12 100644 --- a/source/svg/svg-run.c +++ b/source/svg/svg-run.c @@ -322,9 +322,9 @@ svg_add_arc_segment(fz_context *ctx, fz_path *path, const fz_matrix *mtx, float fz_point p; while (th1 < th0) - th1 += (float)M_PI * 2; + th1 += FZ_PI * 2; - d = (float)M_PI / 180; /* 1-degree precision */ + d = FZ_PI / 180; /* 1-degree precision */ if (iscw) { @@ -336,7 +336,7 @@ svg_add_arc_segment(fz_context *ctx, fz_path *path, const fz_matrix *mtx, float } else { - th0 += (float)M_PI * 2; + th0 += FZ_PI * 2; for (t = th0 - d; t > th1 + d/2; t -= d) { fz_transform_point_xy(&p, mtx, cosf(t), sinf(t)); @@ -452,9 +452,9 @@ svg_add_arc(fz_context *ctx, fz_path *path, th1 = angle_between(coord1, coord2); dth = angle_between(coord3, coord4); if (dth < 0 && !is_clockwise) - dth += (((float)M_PI / 180) * 360); + dth += ((FZ_PI / 180) * 360); if (dth > 0 && is_clockwise) - dth -= (((float)M_PI / 180) * 360); + dth -= ((FZ_PI / 180) * 360); } fz_pre_scale(fz_pre_rotate(fz_translate(&mtx, cx, cy), rotation_angle), rx, ry); |