MCPcopy Create free account
hub / github.com/PageBot/PageBot / circle

Method circle

Lib/pagebot/contexts/basecontext/basecontext.py:247–259  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

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

Callers 1

markerMethod · 0.95

Calls 2

uptFunction · 0.90
ovalMethod · 0.45

Tested by

no test coverage detected