svgmanip icon indicating copy to clipboard operation
svgmanip copied to clipboard

Calling placeat() twice does not work as expected

Open oskeith opened this issue 2 years ago • 0 comments
trafficstars

Considering something similar to the example:

output = Element(384, 356)  # size of the output file.

fate = Element('assets/fate.svg').rotate(-15)
output.placeat(fate, 0.73, 23.55)
output.placeat(fate, 107.81, 8.76)

output.dump('output.svg')

Expected behavior: There will be two of the 'fate' elements at two different positions

Actual behavior: there is one 'fate' element at neither of the specified locations

As a side note, I tried calling the .copy() method but that seems to be from svgutils and doesn't return a svgmanip element. Addiptionally, I tried a loads(.dumps()) to try to make a copy and get the following error, even though when debugging it does appear to be a b'' object

File "[file]", line 37, in place_layout_2 Element.loads(graphic.dumps()) File "C:\Users\keith\miniconda3\lib\site-packages\svgmanip_generator.py", line 141, in dumps out = out.replace("version='1.0'", 'version="1.0"') TypeError: a bytes-like object is required, not 'str'

oskeith avatar Jul 17 '23 18:07 oskeith