Updated according to the version 5.3.0

This commit is contained in:
Maximilian Giller 2019-03-10 07:52:53 +01:00
parent 9e7788b618
commit 332aceb9cf
2 changed files with 3 additions and 15 deletions

View file

@ -13,18 +13,8 @@ class BoxDesign (DesignEntity):
def __define_corners__(self):
topleft = (0,0)
topright = (self.size[0], 0)
bottomleft = (0, self.size[1])
bottomright = self.size
self.corners = [topleft, topright, bottomright, bottomleft]
self.corners = [topleft, bottomright]
def __finish_image__ (self):
for i in range(self.width):
ImageDraw.Draw(self.__image__).polygon(self.__get_reduced_corners__(i), fill=self.fill, outline=self.outline)
def __get_reduced_corners__(self, reducer):
topleft = (reducer, reducer)
topright = (self.size[0] - reducer, reducer)
bottomleft = (reducer, self.size[1] - reducer)
bottomright = (self.size[0] - reducer, self.size[1] - reducer)
return [topleft, topright, bottomright, bottomleft]
ImageDraw.Draw(self.__image__).rectangle(self.corners, fill=self.fill, outline=self.outline, width=self.width)

View file

@ -7,6 +7,4 @@ class EllipseDesign (BoxDesign):
super(EllipseDesign, self).__init__(size, fill=fill, outline=outline, width=width)
def __finish_image__ (self):
for i in range(self.width):
corners = self.__get_reduced_corners__(i)
ImageDraw.Draw(self.__image__).ellipse([corners[0], corners [2]], fill=self.fill, outline=self.outline)
ImageDraw.Draw(self.__image__).ellipse(self.corners, fill=self.fill, outline=self.outline, width=self.width)