INNER CODE UNIT · Python
_draw_logo
pairinteraction/pairinteraction · src/pairinteraction_gui/app.py:93
def _draw_logo(painter: QPainter, size: int) -> None:
"""Draw the PairInteraction logo using QPainter, ported from data/icon.tex (TikZ source)."""
s = size / 19.0
def tx(x: float) -> float:
return (x + 2.0) * s
def ty(y: float) -> float:
return (16.0 - y) * s
painter.save()
painter.setRenderHint(QPainter.RenderHint.Antialiasing)
painter.setClipRect(QRectF(0.0, 0.0, float(size), float(size)))
# White rounded background
painter.setPen(Qt.PenStyle.NoPen)
painter.setBrush(QColor("white"))
painter.drawRoundedRect(QRectF(0.0, 0.0, float(size), float(size)), 4.0 * s, 4.0 * s)