v0.5.3
- Мелкие исправления увеличивающие работу конвертера
This commit is contained in:
@@ -2018,32 +2018,6 @@ def _draw_arrow(
|
||||
return paths
|
||||
|
||||
|
||||
def _draw_purpose(scene: _Scene, d: Idef0Diagram, work: _Rect, s: float, fonts: dict) -> _Rect | None:
|
||||
"""Kept for callers; kit form does not put Purpose/Viewpoint in the work area."""
|
||||
bits = []
|
||||
if d.purpose:
|
||||
bits.append(f"Purpose: {d.purpose}")
|
||||
if d.viewpoint:
|
||||
bits.append(f"Viewpoint: {d.viewpoint}")
|
||||
if not bits:
|
||||
return None
|
||||
font = _load_font(int(fonts["small"]), False)
|
||||
lines: list[str] = []
|
||||
for text in bits:
|
||||
lines.extend(_wrap(text, font, int(work.w * 0.40)))
|
||||
if not lines:
|
||||
return None
|
||||
pad = 3 * s
|
||||
tw, th = _label_block_size(lines, font, fonts["small"], pad)
|
||||
halo = _Rect(work.x + 4 * s, work.b - th - 4 * s, tw, th)
|
||||
scene.rect(halo.x, halo.y, halo.w, halo.h, width=0, fill="#ffffff", outline=None)
|
||||
line_h = fonts["small"] * 1.15
|
||||
y0 = halo.y + pad + fonts["small"] * 0.2
|
||||
for i, ln in enumerate(lines):
|
||||
scene.text(halo.x + pad, y0 + i * line_h, ln, fonts["small"], anchor="lt")
|
||||
return halo.inflate(4 * s)
|
||||
|
||||
|
||||
def render_idef0(
|
||||
diagram: Idef0Diagram,
|
||||
*,
|
||||
|
||||
Reference in New Issue
Block a user