MCPcopy Index your code
hub / github.com/SLiCAP/SLiCAP_python / snap

Function snap

SLiCAP/schematic/config.py:20–23  ·  view source on GitHub ↗
(pos: QPointF)

Source from the content-addressed store, hash-verified

18
19
20def snap(pos: QPointF) -> QPointF:
21 x = round(pos.x() / GRID_SIZE) * GRID_SIZE
22 y = round(pos.y() / GRID_SIZE) * GRID_SIZE
23 return QPointF(x, y)
24
25
26# ── canvas stacking order (Z-values) ──────────────────────────────────────────

Callers 15

itemChangeMethod · 0.85
itemChangeMethod · 0.85
itemChangeMethod · 0.85
itemChangeMethod · 0.85
itemChangeMethod · 0.85
itemChangeMethod · 0.85
itemChangeMethod · 0.85
itemChangeMethod · 0.85
itemChangeMethod · 0.85
itemChangeMethod · 0.85
mousePressEventMethod · 0.85
mouseMoveEventMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected