summaryrefslogtreecommitdiff
path: root/source/fitz/draw-device.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2014-05-26 16:56:34 +0200
committerTor Andersson <tor.andersson@artifex.com>2014-05-26 16:56:34 +0200
commit253a976aa4c0993c0b685deaceefb3220a0825d1 (patch)
tree02db75faf37fe090a89a84f5c10dedfc7f0f7edc /source/fitz/draw-device.c
parent5aa2e01f585075cea6854897503f72fcb6f6a8a0 (diff)
downloadmupdf-253a976aa4c0993c0b685deaceefb3220a0825d1.tar.xz
Fix 695261: separate TM and CTM in outline extraction and stroking steps.
We used to extract the outline using the combined TM*CTM matrix and use the identity transform for stroking, thus ending up with the wrong line width. If we instead extract using the TM and then stroke with the CTM we get the correct results.
Diffstat (limited to 'source/fitz/draw-device.c')
-rw-r--r--source/fitz/draw-device.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source/fitz/draw-device.c b/source/fitz/draw-device.c
index 98b7990c..73a8b585 100644
--- a/source/fitz/draw-device.c
+++ b/source/fitz/draw-device.c
@@ -583,10 +583,10 @@ fz_draw_fill_text(fz_device *devp, fz_text *text, const fz_matrix *ctm,
}
else
{
- fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &trm);
+ fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm);
if (path)
{
- fz_draw_fill_path(devp, path, 0, &fz_identity, colorspace, color, alpha);
+ fz_draw_fill_path(devp, path, 0, ctm, colorspace, color, alpha);
fz_free_path(dev->ctx, path);
}
else
@@ -646,10 +646,10 @@ fz_draw_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke,
}
else
{
- fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &trm);
+ fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm);
if (path)
{
- fz_draw_stroke_path(devp, path, stroke, &fz_identity, colorspace, color, alpha);
+ fz_draw_stroke_path(devp, path, stroke, ctm, colorspace, color, alpha);
fz_free_path(dev->ctx, path);
}
else
@@ -754,7 +754,7 @@ fz_draw_clip_text(fz_device *devp, fz_text *text, const fz_matrix *ctm, int accu
}
else
{
- fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &trm);
+ fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm);
if (path)
{
fz_pixmap *old_dest;
@@ -765,7 +765,7 @@ fz_draw_clip_text(fz_device *devp, fz_text *text, const fz_matrix *ctm, int accu
state[1].mask = NULL;
fz_try(ctx)
{
- fz_draw_fill_path(devp, path, 0, &fz_identity, fz_device_gray(ctx), &white, 1);
+ fz_draw_fill_path(devp, path, 0, ctm, fz_device_gray(ctx), &white, 1);
}
fz_always(ctx)
{
@@ -858,7 +858,7 @@ fz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke
}
else
{
- fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &trm);
+ fz_path *path = fz_outline_glyph(dev->ctx, text->font, gid, &tm);
if (path)
{
fz_pixmap *old_dest;
@@ -870,7 +870,7 @@ fz_draw_clip_stroke_text(fz_device *devp, fz_text *text, fz_stroke_state *stroke
state[0].mask = NULL;
fz_try(ctx)
{
- fz_draw_stroke_path(devp, path, stroke, &fz_identity, fz_device_gray(ctx), &white, 1);
+ fz_draw_stroke_path(devp, path, stroke, ctm, fz_device_gray(ctx), &white, 1);
}
fz_always(ctx)
{