Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Circle with small radius, large scaling and opacity < 1 comes out as a square #1056

Open
alexnoe81 opened this issue May 18, 2023 · 0 comments

Comments

@alexnoe81
Copy link

alexnoe81 commented May 18, 2023

Description

If an svg file contains a circle with small radius (such as 1) which is referenced in a use element with large scaling and opacity < 1, it doesn't come out as a circle. The circle with radius 1 gets rendered into an image, and then, the resulting image of size 2x2 gets scaled and added to the target renderer.

The thing is that gnuplot using the svg terminal creates these kind of svg files, and technically, it is not wrong to do so.

Example data

The following example shows the problem. It's a real gnuplot output where I removed everything except for one circle. Note r='1', scale(9.45) and opacity='0.58'):

<?xml version="1.0" encoding="utf-8"  standalone="no"?>
<svg 
 width="3840" height="2160"
 viewBox="0 0 3840 2160"
 xmlns="http://www.w3.org/2000/svg"
 xmlns:xlink="http://www.w3.org/1999/xlink"
>

<title>Gnuplot</title>
<desc>Produced by GNUPLOT 5.4 patchlevel 5 </desc>

<g id="gnuplot_canvas">
	<rect x="0" y="0" width="3840" height="2160" fill="none"/>
	<defs>
		<circle id='gpPt5' stroke-width='0.074' stroke='currentColor' cx='0' cy='0' r='1'/>
		<use xlink:href='#gpPt5' id='gpPt6' fill='currentColor' stroke='none'/>
	</defs>
	<use xlink:href='#gpPt6' transform='translate(277.22,196.15) scale(9.45)' color='rgb(  0, 192,   0)' opacity='0.58'/>
	</g>
</svg>

Used Versions

NuGet 3.4.4, used in .NET Framework 4.7.2.

@alexnoe81 alexnoe81 changed the title Circle with small radius and large scaling comes out as a square Circle with small radius, large scaling and opacity < 1 comes out as a square May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant