Skip to content

Calling placeat() twice does not work as expected #6

@oskeith

Description

@oskeith

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'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions