Download it now!
Bug 51165 - Incorrect svg fill rendering when a move command is added after a closed shape
Summary: Incorrect svg fill rendering when a move command is added after a closed shape
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
(earliest affected)
Master old -3.6
Hardware: Other All
: medium normal
Assignee: Christina Rossmanith
Whiteboard: target:5.1.0
Depends on:
Blocks: SVG-Open
  Show dependency treegraph
Reported: 2012-06-16 23:25 UTC by Brennan Vincent
Modified: 2018-06-20 17:03 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:

the file (793 bytes, application/xhtml+xml)
2012-06-16 23:25 UTC, Brennan Vincent
Same as pure svg graphic (410 bytes, image/svg+xml)
2013-10-21 18:05 UTC, Regina Henschel
fill with open second subpath (473 bytes, image/svg+xml)
2015-11-06 16:18 UTC, Regina Henschel

Note You need to log in before you can comment on or make changes to this bug.
Description Brennan Vincent 2012-06-16 23:25:10 UTC
Created attachment 63127 [details]
the file

The attached file is rendered correctly by Firefox as a square outlined in blue and filled in orange. It is rendered incorrectly by LibreOffice, which outlines it in blue but does not fill it.

This is due to the "move" SVG path command which follows the close path command "Z". If this move command is removed, the shape is rendered correctly.
Comment 1 Hashem Masoud 2012-09-24 06:48:58 UTC
(In reply to comment #0)

Tested with: Version (Build ID: e29a214) Slackware Linux
Comment 2 Regina Henschel 2013-10-21 18:05:22 UTC
Created attachment 87952 [details]
Same as pure svg graphic

I don't think, that the additional moveto command is the reason. I have extracted the svg graphic to a separate file. Open draw and insert it via Insert > Picture. Notice, that the filling is there.

But when you use File > Open, the filling is missing in LO but not in AOO.

There must be something in addition.

BTW, the XHTML-document is not valid.
Comment 3 Regina Henschel 2013-10-22 08:03:53 UTC
Notice, that when you use File > Open, the svg-graphic is converted to Draw-objects. If you insert the svg-graphic via Insert > Picture it remains a svg-graphic.
Comment 4 QA Administrators 2015-09-04 02:47:59 UTC Comment hidden (obsolete)
Comment 5 Regina Henschel 2015-09-04 08:50:39 UTC
The file open behavior is still wrong as described. I have used
Build ID: fdafa5302df26df4f147b0d2efb6064389a1330c
TinderBox: Win-x86@62-merge-TDF, Branch:MASTER, Time: 2015-08-22_23:42:26
Locale: de-DE (de_DE)
Comment 6 Christina Rossmanith 2015-11-05 21:07:37 UTC
Open the file and hit F8 (edit points). Right click on square -> close object makes the correct fill appear which suggests that it is a rendering and not an import bug.
Comment 7 Regina Henschel 2015-11-06 16:18:10 UTC
Created attachment 120329 [details]
fill with open second subpath

If you close the shape you change its geometry, because this adds an additional line.

You are right, that currently such svg:d path cannot be handled. But the solution is not straight forward, because there is no unique place, where svg:d is handled, see

The implementation misses, that already a subpath in-between can be closed and filled.

ODF has no way to fill an open path. This feature of SVG cannot be mapped to ODF directly. The insert filter generates in such cases a separate polygon purely for filling and polyline for the stroke, to get the same visual appearance.

The attached file really draws lines after the move command. It shows the same problem and makes clear, that simply removing the move command in attachment 87952 [details] would not solve the problem generally.
Comment 8 Commit Notification 2015-11-11 00:53:21 UTC
Chr. Rossmanith committed a patch related to this issue.
It has been pushed to "master":

tdf#51165: handle mixture of open and closed polygons in a path

It will be available in 5.1.0.

The patch should be included in the daily builds available at in the next 24-48 hours. More
information about daily builds can be found at:

Affected users are encouraged to test the fix and report feedback.
Comment 9 Robinson Tryon (qubit) 2015-12-10 04:32:41 UTC Comment hidden (obsolete)
Comment 10 Xisco Faulí 2016-09-15 22:24:37 UTC
Is this bug fixed?
If so, could you please close it as RESOLVED FIXED?