summaryrefslogtreecommitdiff
path: root/source/svg
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@gmail.com>2017-05-28 19:23:02 +0800
committerSebastian Rasmussen <sebras@gmail.com>2017-05-29 18:15:40 +0800
commit154efc3e429508bf27dbd31ebe66b6e1a26b7ded (patch)
tree6c02cc820dd732c0efc44fe401997b39b645bd11 /source/svg
parent2f987ef9812f74be9c272563d200e8ef1bac46ea (diff)
downloadmupdf-154efc3e429508bf27dbd31ebe66b6e1a26b7ded.tar.xz
Make PI/RADIAN/SQRT2/LN2 global single precision float constants.
Diffstat (limited to 'source/svg')
-rw-r--r--source/svg/svg-parse.c6
-rw-r--r--source/svg/svg-run.c10
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);