MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / draw_card

Function draw_card

experiments/human_eval/draw_error_analysis_figure.py:193–210  ·  view source on GitHub ↗
(
    draw: ImageDraw.ImageDraw,
    x: int,
    y: int,
    w: int,
    h: int,
    tag: str,
    tag_color: tuple[int, int, int],
    body: str,
    body_font: ImageFont.FreeTypeFont,
    fill: tuple[int, int, int],
    chars: int,
    tag_text_color: tuple[int, int, int] = TEXT,
)

Source from the content-addressed store, hash-verified

191
192
193def draw_card(
194 draw: ImageDraw.ImageDraw,
195 x: int,
196 y: int,
197 w: int,
198 h: int,
199 tag: str,
200 tag_color: tuple[int, int, int],
201 body: str,
202 body_font: ImageFont.FreeTypeFont,
203 fill: tuple[int, int, int],
204 chars: int,
205 tag_text_color: tuple[int, int, int] = TEXT,
206) -> None:
207 draw.rounded_rectangle((x, y, x + w, y + h), radius=26, fill=fill)
208 tag_w = text_box(draw, tag, F_TAG)[0] + 42
209 draw_badge(draw, x + (w - tag_w) // 2, y - 33, tag, tag_color, tag_text_color)
210 draw_wrapped_text(draw, (x + 22, y + 42), body, body_font, TEXT, chars)
211
212
213def panel_position(idx: int) -> tuple[int, int]:

Callers 1

draw_panelFunction · 0.85

Calls 3

text_boxFunction · 0.85
draw_badgeFunction · 0.85
draw_wrapped_textFunction · 0.85

Tested by

no test coverage detected