MCPcopy Create free account
hub / github.com/SLiCAP/SLiCAP_python / _rubber_band_wires

Method _rubber_band_wires

SLiCAP/schematic/junction_item.py:48–57  ·  view source on GitHub ↗

Move wire endpoints that currently touch this junction.

(self, delta: QPointF)

Source from the content-addressed store, hash-verified

46 return super().itemChange(change, value)
47
48 def _rubber_band_wires(self, delta: QPointF) -> None:
49 """Move wire endpoints that currently touch this junction."""
50 from .wire_item import WireItem
51 pos_key = _pt_key(self.pos())
52 for item in self.scene().items():
53 if not isinstance(item, WireItem):
54 continue
55 hits = {i for i, pt in enumerate(item.points) if _pt_key(pt) == pos_key}
56 if hits:
57 item.move_points(hits, delta)

Callers 1

itemChangeMethod · 0.95

Calls 2

move_pointsMethod · 0.80
_pt_keyFunction · 0.70

Tested by

no test coverage detected