From a5757d578b85f098d57119c9ab8cac4bc290c031 Mon Sep 17 00:00:00 2001 From: Lu Wang Date: Sun, 19 Aug 2012 23:01:21 +0200 Subject: [PATCH] don't mess with draw_ty when we cannot merge the line --- src/HTMLRenderer/state.cc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/HTMLRenderer/state.cc b/src/HTMLRenderer/state.cc index e029143..85c2cfe 100644 --- a/src/HTMLRenderer/state.cc +++ b/src/HTMLRenderer/state.cc @@ -196,23 +196,28 @@ void HTMLRenderer::check_state_change(GfxState * state) */ double dy = cur_ty + cur_rise - draw_ty; - draw_ty += dy; - double tdx = old_ctm[4] - cur_ctm[4] - cur_ctm[2] * dy; double tdy = old_ctm[5] - cur_ctm[5] - cur_ctm[3] * dy; if(_equal(cur_ctm[0] * tdy, cur_ctm[1] * tdx)) { if(abs(cur_ctm[0]) > EPS) + { draw_tx += tdx / cur_ctm[0]; + draw_ty += dy; + } else if (abs(cur_ctm[1]) > EPS) + { draw_tx += tdy / cur_ctm[1]; + draw_ty += dy; + } else { if((abs(tdx) < EPS) && (abs(tdy) < EPS)) { // free draw_tx = cur_tx; + draw_ty += dy; } else {