Draw an oval in rectangle, where (x, y) is the bottom-left and size (w, h). >>> from pagebot.toolbox.color import color, blackColor >>> path = '_export/SvgContext_oval.svg' >>> context = SvgContext() >>> context.newPage(1000, 1000) >>> context.fill(co
(self, x, y, w, h)
| 235 | self._drawing.add(rect) |
| 236 | |
| 237 | def oval(self, x, y, w, h): |
| 238 | """Draw an oval in rectangle, where (x, y) is the bottom-left and size |
| 239 | (w, h). |
| 240 | |
| 241 | >>> from pagebot.toolbox.color import color, blackColor |
| 242 | >>> path = '_export/SvgContext_oval.svg' |
| 243 | >>> context = SvgContext() |
| 244 | >>> context.newPage(1000, 1000) |
| 245 | >>> context.fill(color(r=1, g=0, b=0.5)) |
| 246 | >>> context.oval(pt(0), pt(100), pt(600), pt(200)) |
| 247 | >>> context.stroke(blackColor, pt(20)) |
| 248 | >>> context.fill(color(r=0.4, g=0.1, b=0.9)) |
| 249 | >>> context.oval(pt(300), pt(150), pt(400), pt(600)) |
| 250 | >>> context.saveDrawing(path) |
| 251 | >>> #r = os.system('open %s' % path) |
| 252 | """ |
| 253 | oval = self._drawing.ellipse(center=upt((self._ox+x+w/2), |
| 254 | (self._oy+y+h/2)), r=upt((w/2), (h/2)), |
| 255 | stroke_width=upt(self._strokeWidth), stroke=self._svgStroke, |
| 256 | fill=self._svgFill) |
| 257 | self._drawing.add(oval) |
| 258 | |
| 259 | def circle(self, x, y, r): |
| 260 | """Circle draws a DrawBot oval with (x,y) as middle point and radius r. |
no test coverage detected