(self,x,y,w,h,color,fill=False)
| 225 | # x,y are the top-left corner coordinates. |
| 226 | # w and h are width/height in pixels. |
| 227 | def rect(self,x,y,w,h,color,fill=False): |
| 228 | if fill: |
| 229 | self.set_window(x,y,x+w-1,y+1-w) |
| 230 | if w*h > 256: |
| 231 | buf = color*w |
| 232 | for i in range(h): self.write(None, buf) |
| 233 | else: |
| 234 | buf = color*(w*h) |
| 235 | self.write(None, buf) |
| 236 | else: |
| 237 | self.hline(x,x+w-1,y,color) |
| 238 | self.hline(x,x+w-1,y+h-1,color) |
| 239 | self.vline(y,y+h-1,x,color) |
| 240 | self.vline(y,y+h-1,x+w-1,color) |
| 241 | |
| 242 | # We can draw horizontal and vertical lines very fast because |
| 243 | # we can just set a 1 pixel wide/tall window and fill it. |
nothing calls this directly
no test coverage detected