Bug 692006

Summary: Line across the table on p.1
Product: MuPDF Reporter: zeniko
Component: mupdfAssignee: Tor Andersson <tor.andersson>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P4    
Version: unspecified   
Hardware: PC   
OS: Windows 7   
URL: http://code.google.com/p/sumatrapdf/issues/detail?id=1273
Customer: Word Size: ---
Attachments: patch: insert a fz_moveto after every fz_closepath

Description zeniko 2011-02-28 15:25:09 UTC
From the URL:

In the attached file, on p.1 in the topmost table, a line of the border of the table is not around the table, but it is going across it, in Sumatra, in Acrobat it looks fine.
Comment 1 zeniko 2011-02-28 17:14:16 UTC
Created attachment 7297 [details]
patch: insert a fz_moveto after every fz_closepath

The reason for this bug is that closing a path doesn't return the path to its origin:

<moveto x="58.19" y="534.81" />
<lineto x="563.41" y="534.81" />
<lineto x="563.41" y="519.69" />
<lineto x="58.19" y="519.69" />
<closepath />
<lineto x="563.41" y="534.81" />
<lineto x="563.41" y="288.79" />
<lineto x="58.19" y="288.79" />
<closepath />

Repeating the original moveto before a lineto following right after a closepath results in the expected rendering.
Comment 2 zeniko 2011-02-28 18:02:16 UTC
Right, pointers are tricky. We're going with http://code.google.com/p/sumatrapdf/source/detail?r=2885 for now. The cleaner solution would be to add a pair of coordinates to FZ_CLOSEPATH instead of inserting these spurious FZ_MOVETO instructions - as otherwise dev_trace and fz_debugpath will show them as well.