Example #1
0
File: PIL.py Project: bgnori/bglib
 def draw_rect(self, position, size, fill=None):
     assert self.dc is not None
     draw = self.dc[1]
     x2, y2 = position
     x2 += size[0]
     y2 += size[1]
     draw.rectangle([position, (x2 - 1, y2 - 1)], fill=fill)
Example #2
0
File: wx2.py Project: bgnori/bglib
 def draw_rect(self, position, size, fill=None):
   position=self.calc_mag(position)
   size=self.calc_mag(size)
   draw = self.dc[1]
   x2, y2 = position
   x2 += size[0]
   y2 += size[1]
   draw.rectangle([position, (x2-1, y2-1)], fill=fill)