Fixed size bug

This commit is contained in:
Maximilian Giller 2020-04-28 13:30:29 +02:00
parent 83f8f37447
commit b7ede5a026

View file

@ -11,9 +11,10 @@ class DesignEntity (object):
def __init__(self, size, mask=False, invert_mask=False, color_key=False): def __init__(self, size, mask=False, invert_mask=False, color_key=False):
self.size = size self.size = size
# Are dimensions >= 0? # Are dimensions >= 0?
for i in range(2): if self.size[0] < 0:
if self.size[i] < 0: self.size = (0, self.size[1])
self.size[i] = 0 if self.size[1] < 0:
self.size = (self.size[0], 0)
self.pos = (0, 0) self.pos = (0, 0)
self.mask = mask self.mask = mask