simple object with mask renders incorrectly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
New
|
Undecided
|
Unassigned |
Bug Description
Inkscape 4.8 (on Ubuntu 11.10, and win7) renders a simple object differently to Batik, firefox, and even IE9 which all display the graphic as I expect.
Basically I have a partially hand written .svg file that is part of a larger project that certain elements don't seem to render in Inkscape. The problematic part seems to be a group where one shape is masked by another. The masks in this case are 'reversed' so that a rect at the size of the image is created first and filled white. The mask is a path inside this filled black. Having the effect of cutting the masked path out, there are reasons cuts are inappropriate for this application.
Anyway, this boiled down svg doc shows the issue. The colours are set here so that the base shape, outer mask and inner mask are all visible in the result.
<code>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://
<svg xmlns:svg="http://
<defs id="includes">
<style type="text/
.seeme {
fill: black;
}
.inmask {
fill: blue;
}
.outmask {
fill: green;
}
]]></style>
</defs>
<g id="masked_rect">
<mask id="createhole">
<rect class="inmask" id="maskin" width="100%" height="100%" />
<rect class="outmask" id="maskout" width="80" height="80" x="60" y="60" />
</mask>
<rect class="seeme" id="outsiderect" mask="url(
</g>
</svg>
</code>
I have noticed when trying to work out why my images weren't rendering as expected that after moving objects up/down - in/out of the tree in the svg editor, sometimes they would display as expected. This persists until you reload the image. I know that I am not working with images created in Inkscape, but everything else (including *gag* IE9) renders them as I expect.
Workaround for Inkscape (0.48.2 and current trunk): use a group as mask containing the two rectangles 'maskin' and 'maskout' (instead of them being direct children of the <mask> object).