-
Notifications
You must be signed in to change notification settings - Fork 88
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
Issues with SVGFigure Width and Height not being set #73
Comments
I'd expect svg_utils/src/svgutils/transform.py Line 244 in 10a0820
|
PS: Works for me with 0.3.4: # cd "$(mktemp -d)"
# virtualenv --python=python3.9 venv
# source venv/bin/activate
# pip install svgutils==0.3.4
# python -c $'import svgutils\nsvgutils.transform.SVGFigure(width=1000.0, height=1000.0)' && echo 'no exception'
no exception |
Hello I used pip3 install svgutils
I believe it is version 0.3.4
How would I check?
… On Apr 16, 2021, at 10:41 AM, Sebastian Pipping ***@***.***> wrote:
I'd expect that to raise AttributeErrorwhich is handled at https://github.com/btel/svg_utils/blob/10a082008a40a387cd80ef044c3efe6a8aa79bd6/src/svgutils/transform.py#L244 . Which version of svgutils are you running?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
# pip show svgutils | fgrep Version:
Version: 0.3.4 |
Hello Again I took your example where no exception was generated and ran the following test. Use your code to generate a figure. Save that figure and look for the width and the height values in the svg file. No Value for Width or Height are saved to the file. This indicated that the values for Width and Height are not being saved. ~ % cat tmp.svg ~ %Python 3.9.2 (default, Mar 15 2021, 17:37:51)
Please note I stepped through the code and the width and the height values are not saved. Robert |
I confirm: the written SVG file does not carry width and height with svgutils 0.3.4. I guess #62 was not the full deal, then. |
If you look at the code for the Width and the Height the "value.value" does not work. ef width(self, value): |
Yes, that is why |
There is also an issue setting a value to a percentage, since the |
In the following code, I wanted to create an sag with a size of 1000 by 1000. Stepping through the code the values of the width and the height were not set because they generated an exception in the Width and Height Setters. This resulted in the width and the height not being set.
Please note that I tried many combinations of values for width and height.
When the code reach the setter, the line self._width = value.value would fail.
I replaced self._width = value. This fixed my problem.
robert
The text was updated successfully, but these errors were encountered: