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

addSVGNoLayout not working #24

Open
mgraupe opened this issue Sep 14, 2022 · 0 comments
Open

addSVGNoLayout not working #24

mgraupe opened this issue Sep 14, 2022 · 0 comments

Comments

@mgraupe
Copy link

mgraupe commented Sep 14, 2022

Rather than concatenating different .svg files like in the example. I would like to insert .svg files into a larger main figure. For that purpose, I have used the addSVGNoLayout() function in the past. However, I cannot get it to work using the current repository version.

When running the code below, I get the output that the width of the two added figures is scales to zero. Might that be the problem?
Output :

Changing width of blue_triangle.svg from 235.29 to 0.00
Changing height of blue_triangle.svg from 141.00 to 1122.52
Changing width of red_ball.svg from 198.14 to 0.00
Changing height of red_ball.svg from 198.14 to 1122.52

And here is the example code.

#!/usr/bin/env python

import svg_stack as svgs
import os

doc = svgs.Document()

layout1 = svgs.HBoxLayout() # VBoxLayout()
layout1.addSVG('page.svg' ,alignment=svgs.AlignTop|svgs.AlignHCenter)
layout1.addSVGNoLayout('blue_triangle.svg',x=100,y=100)
layout1.addSVGNoLayout('red_ball.svg',x=100,y=100)

doc.setLayout(layout1)

fignameCompose = 'qt_api_test2'
doc.save('%s.svg' % fignameCompose)

Thanks in advance.

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