summaryrefslogtreecommitdiffstats
path: root/src/libharu-1-fixes.patch
diff options
context:
space:
mode:
Diffstat (limited to 'src/libharu-1-fixes.patch')
-rw-r--r--src/libharu-1-fixes.patch51
1 files changed, 51 insertions, 0 deletions
diff --git a/src/libharu-1-fixes.patch b/src/libharu-1-fixes.patch
index 65a17f7..fc12fdb 100644
--- a/src/libharu-1-fixes.patch
+++ b/src/libharu-1-fixes.patch
@@ -354,3 +354,54 @@ index b8f831e..6057424 100644
--
1.7.8.3
+Wt requires the following patch for libHaru to render arcs correctly.
+This patch has been tested against libhar 2.1.0 and 2.2.0.
+(see http://redmine.webtoolkit.eu/projects/wt/wiki/LibHaru)
+
+diff -ur a/src/hpdf_page_operator.c b/src/hpdf_page_operator.c
+--- a/src/hpdf_page_operator.c 2010-02-01 07:26:13.000000000 -0300
++++ b/src/hpdf_page_operator.c 2012-03-10 18:12:41.347028623 -0300
+@@ -2192,7 +2192,7 @@
+
+ HPDF_PTRACE ((" HPDF_Page_Arc\n"));
+
+- if (ang1 >= ang2 || (ang2 - ang1) >= 360)
++ if (fabs(ang2 - ang1) >= 360)
+ HPDF_RaiseError (page->error, HPDF_PAGE_OUT_OF_RANGE, 0);
+
+ if (ret != HPDF_OK)
+@@ -2205,10 +2205,10 @@
+
+
+ for (;;) {
+- if (ang2 - ang1 <= 90)
++ if (fabs(ang2 - ang1) <= 90)
+ return InternalArc (page, x, y, ray, ang1, ang2, cont_flg);
+ else {
+- HPDF_REAL tmp_ang = ang1 + 90;
++ HPDF_REAL tmp_ang = (ang2 > ang1 ? ang1 + 90 : ang1 - 90);
+
+ if ((ret = InternalArc (page, x, y, ray, ang1, tmp_ang, cont_flg))
+ != HPDF_OK)
+@@ -2217,7 +2217,7 @@
+ ang1 = tmp_ang;
+ }
+
+- if (ang1 >= ang2)
++ if (fabs(ang1 - ang2) < 0.1)
+ break;
+
+ cont_flg = HPDF_TRUE;
+@@ -2280,7 +2280,11 @@
+ pbuf = HPDF_FToA (pbuf, (HPDF_REAL)x0, eptr);
+ *pbuf++ = ' ';
+ pbuf = HPDF_FToA (pbuf, (HPDF_REAL)y0, eptr);
+- pbuf = (char *)HPDF_StrCpy (pbuf, " m\012", eptr);
++
++ if (attr->gmode == HPDF_GMODE_PATH_OBJECT)
++ pbuf = (char *)HPDF_StrCpy (pbuf, " l\012", eptr);
++ else
++ pbuf = (char *)HPDF_StrCpy (pbuf, " m\012", eptr);
+ }
+
+ pbuf = HPDF_FToA (pbuf, (HPDF_REAL)x1, eptr);