Circle draws a `circle` with (x, y) as middle point and radius r. TODO: draw as path? >>> from pagebot import getContext >>> context = getContext() >>> context.newPage(420, 420) >>> context.circle(pt(100), pt(200), pt(50)) >>> context.circle(100, 200,
(self, x, y, r)
| 245 | self.b.oval(xpt, ypt, wpt, hpt) |
| 246 | |
| 247 | def circle(self, x, y, r): |
| 248 | """Circle draws a `circle` with (x, y) as middle point and radius r. |
| 249 | TODO: draw as path? |
| 250 | |
| 251 | >>> from pagebot import getContext |
| 252 | >>> context = getContext() |
| 253 | >>> context.newPage(420, 420) |
| 254 | >>> context.circle(pt(100), pt(200), pt(50)) |
| 255 | >>> context.circle(100, 200, 50) |
| 256 | """ |
| 257 | # Render units to points. |
| 258 | xpt, ypt, rpt = upt(x, y, r) |
| 259 | self.b.oval(xpt-rpt, ypt-rpt, 2*rpt, 2*rpt) |
| 260 | |
| 261 | # Path. |
| 262 |