[cairo] possible bug with cairo_scale & librsvg

Matthew Bernstein mwb at globalmaritime.com
Fri Oct 13 00:45:45 PDT 2006


Carl Worth wrote:
> On Wed, 11 Oct 2006 13:51:56 +0100, Matthew Bernstein wrote:
>> I'm trying to track down a bug rendering SVG files with librsvg if
>> cairo_scale is used with a factor other than 1.0.
> 
> An SVG that reproduces the problem would be necessary to start
> tracking down the problem. And preferably something that was trimmed
> down to the minimum that still reproduces the problem.

Okay, that wasn't quite as painful as I was expecting... The problem was
related to the use of clipPath (the use appears correct, looking at the
spec) and can be demonstrated with the simplified example below.  Do you
know if the clipping takes place in Cairo or Librsvg?

I've put the results for scaling factors of 0.5, 1.0, 1.5 from both
Cairo and Batik up here:

http://downloads.globalmaritime.com/ts/cairo/


<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="400" height="400" viewBox="0 0 400 400"
    xmlns="http://www.w3.org/2000/svg"
    xmlns:xlink="http://www.w3.org/1999/xlink"
    version="1.1" id="svg1">
<defs>
	<clipPath id="1001">
		<rect x="100" y="100" width="200" height="200"/>
	</clipPath>
</defs>
<g id="showclip">
	<rect style="stroke: #000000; fill:none;" x="100" y="100" width="200"
height="200"/>
</g>
<g id="lines">
	<path style="stroke: #000000;" d="M 150,50 L 150,350"/>
	<path style="stroke: #000000; clip-path:url(#1001);" d="M 250,50 L
250,350"/>
</g>
</svg>


Thanks,
Matthew




More information about the cairo mailing list