MCPcopy Create free account
hub / github.com/Image-Py/imagepy / draw_circle

Function draw_circle

imagepy/core/mark/mark.py:123–157  ·  view source on GitHub ↗
(pts, dc, f, **key)

Source from the content-addressed store, hash-verified

121 dc.SetBrush(brush)
122
123def draw_circle(pts, dc, f, **key):
124 pen, brush = dc.GetPen(), dc.GetBrush()
125 width, color = pen.GetWidth(), pen.GetColour()
126 fcolor, style = brush.GetColour(), brush.GetStyle()
127
128 if 'color' in pts:
129 pen.SetColour(pts['color'])
130 if 'fcolor' in pts:
131 brush.SetColour(pts['fcolor'])
132 if 'lw' in pts:
133 pen.SetWidth(pts['lw'])
134 if 'fill' in pts:
135 brush.SetStyle((106,100)[pts['fill']])
136
137 dc.SetPen(pen)
138 dc.SetBrush(brush)
139
140 if pts['type'] == 'circle':
141 x, y ,r = pts['body']
142 x, y = f(x, y)
143 dc.DrawCircle(x, y, r*key['k'])
144 if pts['type'] == 'circles':
145 lst = []
146 for x, y ,r in pts['body']:
147 x, y = f(x, y)
148 r *= key['k']
149 lst.append((x-r,y-r,r*2,r*2))
150 dc.DrawEllipseList(lst)
151
152 pen.SetWidth(width)
153 pen.SetColour(color)
154 brush.SetColour(fcolor)
155 brush.SetStyle(style)
156 dc.SetPen(pen)
157 dc.SetBrush(brush)
158
159def make_ellipse(l1, l2, ang):
160 m = np.array([[l1*cos(-ang),-l2*sin(-ang)],

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
fFunction · 0.50

Tested by

no test coverage detected