MCPcopy Create free account
hub / github.com/microsoft/TypeChat / draw_ellipse

Function draw_ellipse

python/examples/drawing/render.py:30–42  ·  view source on GitHub ↗
(ellipse: Ellipse)

Source from the content-addressed store, hash-verified

28 canvas.create_text((x1 + x2) / 2, (y1 + y2) / 2, text=box.text, fill="black")
29
30 def draw_ellipse(ellipse: Ellipse):
31 x1, y1 = ellipse.x, ellipse.y
32 x2, y2 = x1 + ellipse.width, y1 + ellipse.height
33 canvas.create_oval(
34 x1,
35 y1,
36 x2,
37 y2,
38 outline=getattr(ellipse.style, "line_color", None) or "black",
39 fill=getattr(ellipse.style, "fill_color", None) or "",
40 )
41 if ellipse.text:
42 canvas.create_text((x1 + x2) / 2, (y1 + y2) / 2, text=ellipse.text, fill="black")
43
44 def draw_arrow(arrow: Arrow):
45 line_style = getattr(arrow.style, "line_style", None) or "solid"

Callers 1

render_drawingFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…