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

Method circle

Lib/pagebot/contexts/flatcontext/flatcontext.py:1108–1120  ·  view source on GitHub ↗

Draws a circle in a square with radius r and (x, y) as center. TODO: don't scale width and height but calculate points before transforming.

(self, x, y, r)

Source from the content-addressed store, hash-verified

1106 self.drawShapePath()
1107
1108 def circle(self, x, y, r):
1109 """Draws a circle in a square with radius r and (x, y) as center.
1110
1111 TODO: don't scale width and height but calculate points before
1112 transforming.
1113 """
1114 shape = self._getShape()
1115
1116 if shape is not None:
1117 x, y = self.getTransformed(x, y)
1118 r = r * self._sx
1119 ptx, pty, pr = upt(x, y, r)
1120 self.page.place(shape.circle(ptx, pty, pr))
1121
1122 def line(self, p0, p1):
1123 """Draws a line from point p0 to point p1."""

Callers

nothing calls this directly

Calls 4

_getShapeMethod · 0.95
getTransformedMethod · 0.95
uptFunction · 0.90
placeMethod · 0.80

Tested by

no test coverage detected