astraw / svg_stack

concatenate SVG files
164 stars 45 forks source link

addSVGNoLayout not working #24

Open mgraupe opened 2 years ago

mgraupe commented 2 years ago

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.