Bug 39551 - An open path becomes closed if endpoints are aligned vertically
Summary: An open path becomes closed if endpoints are aligned vertically
Status: RESOLVED FIXED
Alias: None
Product: cairo
Classification: Unclassified
Component: general (show other bugs)
Version: 1.10.2
Hardware: All All
: medium normal
Assignee: Carl Worth
QA Contact: cairo-bugs mailing list
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-07-26 05:14 UTC by Andrzej
Modified: 2012-04-14 06:45 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Input file (Inkscape) (1.93 KB, image/svg+xml)
2011-07-26 05:14 UTC, Andrzej
Details
An exported pdf file (979 bytes, application/pdf)
2011-07-26 05:15 UTC, Andrzej
Details

Description Andrzej 2011-07-26 05:14:27 UTC
Created attachment 49567 [details]
Input file (Inkscape)

See Inkscape bug report: https://bugs.launchpad.net/inkscape/+bug/759154
and discussion: http://thread.gmane.org/gmane.comp.graphics.inkscape.user/13632

The way to reproduce the bug in Inkscape is to draw a U-shaped path in such a way that its endpoints are vertically aligned (use a snap to grid function). The end segments of the path should be horizontal.

The path is displayed correctly on the screen but when exported to a pdf or eps file an additional vertical segment is added connecting the endpoints.

The bug was first observed in Cairo version 1.10.0 and is still present in newer versions, including 1.10.2 shipped with Ubuntu 11.04.

There are also reports (see the discussion above) that other software using Cairo is affected as well.
Comment 1 Andrzej 2011-07-26 05:15:17 UTC
Created attachment 49569 [details]
An exported pdf file
Comment 2 Andrea Canciani 2011-07-26 06:02:22 UTC
This looks like a duplicate of #34560...

Can you please check if
commit 36e0cad71aa7b9a84fb31fba333175cbf445ab4e
Author: Andrea Canciani <ranma42@gmail.com>
Date:   Tue Mar 8 10:26:06 2011 +0100

    path: Fix _cairo_path_fixed_is_rectangle()
    
    __cairo_path_fixed_is_rectangle() is used by the PS and PDF backends
    to check if a path is equivalent to a rectangle when stroking. This is
    different from being a rectangle when filling, because of the implicit
    close_path appended to every subpath when filling.
    
    Fixes stroke-open-box.
    
    See https://bugs.freedesktop.org/show_bug.cgi?id=34560

from the 1.10 branch fixes it?
Comment 3 Andrzej 2011-07-26 06:22:32 UTC
Andrea, this might be some other, although perhaps related, issue.

I'm currently using Cairo 1.10.2 and it is affected by this error. As is 1.10.0 and 1.11.2 (based on reports from other people). I presume they all include the patch you mentioned.

The latest version that produced desired output was Cairo 1.8.10.
Comment 4 Andrea Canciani 2011-07-26 06:54:43 UTC
(In reply to comment #3)
> Andrea, this might be some other, although perhaps related, issue.
> 
> I'm currently using Cairo 1.10.2 and it is affected by this error. As is 1.10.0
> and 1.11.2 (based on reports from other people). I presume they all include the
> patch you mentioned.

Unfortunately they do not. No release of cairo currently includes that patch.

> 
> The latest version that produced desired output was Cairo 1.8.10.
Comment 5 Andrzej 2011-07-26 07:19:29 UTC
Thanks, Andrea. I've forwarded your request to the Inkscape bug tracker (I'm not the most competent person when it comes to building some non-trivial software).
Comment 6 ~suv 2012-01-11 09:52:28 UTC
(In reply to comment #2)
> This looks like a duplicate of #34560...
> 
> Can you please check if
> commit 36e0cad71aa7b9a84fb31fba333175cbf445ab4e
> Author: Andrea Canciani <ranma42@gmail.com>
> Date:   Tue Mar 8 10:26:06 2011 +0100
(…)
> from the 1.10 branch fixes it?

Patch from [1] tested with cairo 1.10.2 on OS X 10.7.2 Lion,
fix confirmed with Inkscape 0.48.2 and Inkscape 0.48+devel r10869


[1] <http://cgit.freedesktop.org/cairo/commit/?h=1.10&id=36e0cad71aa7b9a84fb31fba333175cbf445ab4e>
Comment 7 Chris Wilson 2012-04-14 06:45:02 UTC
Thanks for the testing and feedback.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.