summaryrefslogtreecommitdiff
path: root/source/fitz/draw-path.c
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/fitz/draw-path.c
parent2f987ef9812f74be9c272563d200e8ef1bac46ea (diff)
downloadmupdf-154efc3e429508bf27dbd31ebe66b6e1a26b7ded.tar.xz
Make PI/RADIAN/SQRT2/LN2 global single precision float constants.
Diffstat (limited to 'source/fitz/draw-path.c')
-rw-r--r--source/fitz/draw-path.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/fitz/draw-path.c b/source/fitz/draw-path.c
index 0dec60b8..fe140a56 100644
--- a/source/fitz/draw-path.c
+++ b/source/fitz/draw-path.c
@@ -338,20 +338,20 @@ fz_add_arc(fz_context *ctx, sctx *s,
int n, i;
r = fabsf(s->linewidth);
- theta = 2 * (float)M_SQRT2 * sqrtf(s->flatness / r);
+ theta = 2 * FZ_SQRT2 * sqrtf(s->flatness / r);
th0 = atan2f(y0, x0);
th1 = atan2f(y1, x1);
if (r > 0)
{
if (th0 < th1)
- th0 += (float)M_PI * 2;
+ th0 += FZ_PI * 2;
n = ceilf((th0 - th1) / theta);
}
else
{
if (th1 < th0)
- th1 += (float)M_PI * 2;
+ th1 += FZ_PI * 2;
n = ceilf((th1 - th0) / theta);
}
@@ -549,12 +549,12 @@ fz_add_line_cap(fz_context *ctx, sctx *s, float ax, float ay, float bx, float by
case FZ_LINECAP_ROUND:
{
int i;
- int n = ceilf((float)M_PI / (2.0f * (float)M_SQRT2 * sqrtf(flatness / linewidth)));
+ int n = ceilf(FZ_PI / (2.0f * FZ_SQRT2 * sqrtf(flatness / linewidth)));
float ox = bx - dlx;
float oy = by - dly;
for (i = 1; i < n; i++)
{
- float theta = (float)M_PI * i / n;
+ float theta = FZ_PI * i / n;
float cth = cosf(theta);
float sth = sinf(theta);
float nx = bx - dlx * cth - dly * sth;
@@ -595,7 +595,7 @@ fz_add_line_dot(fz_context *ctx, sctx *s, float ax, float ay)
{
float flatness = s->flatness;
float linewidth = s->linewidth;
- int n = ceilf((float)M_PI / ((float)M_SQRT2 * sqrtf(flatness / linewidth)));
+ int n = ceilf(FZ_PI / (FZ_SQRT2 * sqrtf(flatness / linewidth)));
float ox = ax - linewidth;
float oy = ay;
int i;
@@ -604,7 +604,7 @@ fz_add_line_dot(fz_context *ctx, sctx *s, float ax, float ay)
n = 3;
for (i = 1; i < n; i++)
{
- float theta = (float)M_PI * 2 * i / n;
+ float theta = FZ_PI * 2 * i / n;
float cth = cosf(theta);
float sth = sinf(theta);
float nx = ax - cth * linewidth;