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

Function draw_box

python/examples/drawing/render.py:16–28  ·  view source on GitHub ↗
(box: Box)

Source from the content-addressed store, hash-verified

14def render_drawing(canvas: tk.Canvas, drawing: Drawing):
15
16 def draw_box(box: Box):
17 x1, y1 = box.x, box.y
18 x2, y2 = x1 + box.width, y1 + box.height
19 canvas.create_rectangle(
20 x1,
21 y1,
22 x2,
23 y2,
24 outline=getattr(box.style, "line_color", None) or "black",
25 fill=getattr(box.style, "fill_color", None) or "",
26 )
27 if box.text:
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

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…