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

Glue does not support decimal margins #234

Open
hmvmacutay opened this issue Dec 29, 2020 · 0 comments
Open

Glue does not support decimal margins #234

hmvmacutay opened this issue Dec 29, 2020 · 0 comments

Comments

@hmvmacutay
Copy link

Is there any update in the future to support decimal inputs for margins? I tried creating a sprite with margin='5 2.5' but gave me the following error:

Version: 0.13
Python: 3.8.2 (default, Jun 22 2020, 10:14:57)
[GCC 7.5.0]
Traceback (most recent call last):
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/bin.py", line 235, in main
manager.process()
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/managers/base.py", line 12, in process
self.find_sprites()
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/managers/simple.py", line 12, in find_sprites
self.add_sprite(path=self.config['source'])
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/managers/base.py", line 23, in add_sprite
sprite = Sprite(path=path, config=self.config)
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/core.py", line 191, in init
self.images = self._locate_images()
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/core.py", line 274, in _locate_images
images = sorted(images, reverse=self.config['algorithm_ordering'][0] != '-')
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/core.py", line 163, in lt
return max(self.absolute_width, self.absolute_height) <= max(img.absolute_width, img.absolute_height)
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/core.py", line 138, in absolute_width
return round_up(self.width + self.horizontal_spacing * max(self.config['ratios']))
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/helpers.py", line 58, in get
value = self.func(obj)
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/core.py", line 127, in horizontal_spacing
return self.padding[1] + self.padding[3] + self.margin[1] + self.margin[3]
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/core.py", line 105, in margin
return self._generate_spacing_info(self.config['margin'])
File "/home/administrator/.pyenv/versions/3.8.2/lib/python3.8/site-packages/glue/core.py", line 122, in _generate_spacing_info
return list(map(int, data))
ValueError: invalid literal for int() with base 10: '2.5'

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