MCPcopy Create free account
hub / github.com/MaureenZOU/TSAM / drawrect

Function drawrect

src/utils/util.py:216–232  ·  view source on GitHub ↗
(drawcontext, xy, outline=None, width=0, partial=None)

Source from the content-addressed store, hash-verified

214
215
216def drawrect(drawcontext, xy, outline=None, width=0, partial=None):
217 (x1, y1), (x2, y2) = xy
218 if partial is None:
219 points = (x1, y1), (x2, y1), (x2, y2), (x1, y2), (x1, y1)
220 drawcontext.line(points, fill=outline, width=width)
221 else:
222 drawcontext.line([(x1, y1), (x1, y1 + partial)], fill=outline, width=width)
223 drawcontext.line([(x1 + partial, y1), (x1, y1)], fill=outline, width=width)
224
225 drawcontext.line([(x2, y1), (x2, y1 + partial)], fill=outline, width=width)
226 drawcontext.line([(x2, y1), (x2 - partial, y1)], fill=outline, width=width)
227
228 drawcontext.line([(x1, y2), (x1 + partial, y2)], fill=outline, width=width)
229 drawcontext.line([(x1, y2), (x1, y2 - partial)], fill=outline, width=width)
230
231 drawcontext.line([(x2 - partial, y2), (x2, y2)], fill=outline, width=width)
232 drawcontext.line([(x2, y2), (x2, y2 - partial)], fill=outline, width=width)
233
234
235def get_everything_under(root_dir, pattern='*', only_dirs=False, only_files=False):

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected