( self, cx, cy, r, fill=False )
| 374 | self._drawLines( segs ) |
| 375 | |
| 376 | def drawCircle( self, cx, cy, r, fill=False ): |
| 377 | x = 0 |
| 378 | y = r |
| 379 | d = 1 - r |
| 380 | |
| 381 | self.plotPoint(cx, cy + y) |
| 382 | self.plotPoint(cx, cy - y) |
| 383 | if fill: |
| 384 | self.drawLine(cx - y, cy, cx + y, cy) |
| 385 | else: |
| 386 | self.plotPoint(cx + y, cy) |
| 387 | self.plotPoint(cx - y, cy) |
| 388 | |
| 389 | while( y > x ): |
| 390 | if ( d < 0 ): |
| 391 | d += ( 2*x + 3 ) |
| 392 | else: |
| 393 | d += ( 2*(x-y) + 5 ) |
| 394 | y -= 1 |
| 395 | x += 1 |
| 396 | |
| 397 | if fill: |
| 398 | self.drawLine(cx + x - 1, cy + y, cx - x + 1, cy + y) |
| 399 | self.drawLine(cx - x + 1, cy - y, cx + x - 1, cy - y) |
| 400 | self.drawLine(cx + y - 1, cy + x, cx - y + 1, cy + x) |
| 401 | self.drawLine(cx - y + 1, cy - x, cx + y - 1, cy - x) |
| 402 | else: |
| 403 | self.plotPoint(cx + x, cy + y) |
| 404 | self.plotPoint(cx + y, cy + x) |
| 405 | self.plotPoint(cx - x, cy - y) |
| 406 | self.plotPoint(cx - y, cy - x) |
| 407 | self.plotPoint(cx + x, cy - y) |
| 408 | self.plotPoint(cx - y, cy + x) |
| 409 | self.plotPoint(cx - x, cy + y) |
| 410 | self.plotPoint(cx + y, cy - x) |
| 411 | |
| 412 | def _saveBitMapNoCompression( self ): |
| 413 | line_padding = (4 - (self.wd % 4)) % 4 |
no test coverage detected