summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-01-09 14:24:14 +0000
committerRobin Watts <robin@ghostscript.com>2012-01-10 18:07:12 +0000
commit0230a0417212172c391483d054364fb081c79168 (patch)
tree732333cb183c35b97fd04e0f759af2eb49e5d45d /fitz
parent6019356f6efd8d71bba7843de4262322529dfcae (diff)
downloadmupdf-0230a0417212172c391483d054364fb081c79168.tar.xz
Move fuzz from fz_execute_display_list into fz_bound_text.
Keep the fuzz in just one place. Hopefully will be rendered unnecessary by changes to make fz_bound_text accurate.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/dev_list.c8
-rw-r--r--fitz/res_text.c7
2 files changed, 7 insertions, 8 deletions
diff --git a/fitz/dev_list.c b/fitz/dev_list.c
index c6a71ec9..b77cb9e4 100644
--- a/fitz/dev_list.c
+++ b/fitz/dev_list.c
@@ -602,14 +602,6 @@ fz_execute_display_list(fz_display_list *list, fz_device *dev, fz_matrix top_ctm
int empty;
int progress = 0;
- if (!fz_is_infinite_bbox(scissor))
- {
- /* add some fuzz at the edges, as especially glyph rects
- * are sometimes not actually completely bounding the glyph */
- scissor.x0 -= 20; scissor.y0 -= 20;
- scissor.x1 += 20; scissor.y1 += 20;
- }
-
if (cookie)
{
cookie->progress_max = list->last - list->first;
diff --git a/fitz/res_text.c b/fitz/res_text.c
index 63338435..fae2606b 100644
--- a/fitz/res_text.c
+++ b/fitz/res_text.c
@@ -98,6 +98,13 @@ fz_bound_text(fz_text *text, fz_matrix ctm)
bbox.x1 += fbox.x1;
bbox.y1 += fbox.y1;
+ /* add some fuzz at the edges, as font bbox is often not accurate.
+ * Better to localise this fuzz in just this one place than have it
+ * everywhere that looks at these results. If we ever change to using
+ * freetype to exactly bound text, we can remove this. */
+ bbox.x0 -= 20; bbox.y0 -= 20;
+ bbox.x1 += 20; bbox.y1 += 20;
+
return bbox;
}