diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2018-02-23 00:02:07 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2018-02-27 14:08:02 +0100 |
commit | 6f199ed40fdeab280e745502fa0de13d814b9343 (patch) | |
tree | 393be043caa79f24b09c220dbe72cd5a5aa11b2c /source | |
parent | 028851638ce03d77de1385bee92ada98620e6d7a (diff) | |
download | mupdf-6f199ed40fdeab280e745502fa0de13d814b9343.tar.xz |
svg: Fix circle/ellipse drawing.
Diffstat (limited to 'source')
-rw-r--r-- | source/svg/svg-run.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source/svg/svg-run.c b/source/svg/svg-run.c index 4b7724f6..8525db07 100644 --- a/source/svg/svg-run.c +++ b/source/svg/svg-run.c @@ -65,13 +65,13 @@ static const float MAGIC_CIRCLE = 0.551915f; static void approx_circle(fz_context *ctx, fz_path *path, float cx, float cy, float rx, float ry) { - float rxs = rx * MAGIC_CIRCLE; - float rys = ry * MAGIC_CIRCLE; + float mx = rx * MAGIC_CIRCLE; + float my = ry * MAGIC_CIRCLE; fz_moveto(ctx, path, cx, cy+ry); - fz_curveto(ctx, path, cx + rxs, cy + ry, cx + rx, cy + rys, cx + rx, cy); - fz_curveto(ctx, path, cx + rx, cy - rys, cx + rxs, cy - rys, cx, cy - ry); - fz_curveto(ctx, path, cx - rxs, cy - ry, cx - rx, cy - rys, cx - rx, cy); - fz_curveto(ctx, path, cx - rx, cy + rys, cx - rxs, cy + rys, cx, cy + ry); + fz_curveto(ctx, path, cx + mx, cy + ry, cx + rx, cy + my, cx + rx, cy); + fz_curveto(ctx, path, cx + rx, cy - my, cx + mx, cy - ry, cx, cy - ry); + fz_curveto(ctx, path, cx - mx, cy - ry, cx - rx, cy - my, cx - rx, cy); + fz_curveto(ctx, path, cx - rx, cy + my, cx - mx, cy + ry, cx, cy + ry); fz_closepath(ctx, path); } |