(self, *, commit: bool)
| 922 | self._refresh_preview(self._last_cursor) |
| 923 | |
| 924 | def _end_wire(self, *, commit: bool): |
| 925 | if self._wire_preview is not None: |
| 926 | self.removeItem(self._wire_preview) |
| 927 | self._wire_preview = None |
| 928 | committed = commit and len(self._wire_points) >= 2 |
| 929 | if committed: |
| 930 | self._push_undo() |
| 931 | self.addItem(WireItem(self._wire_points)) |
| 932 | self._wire_points = [] |
| 933 | if self._mode == _Mode.WIRING: |
| 934 | self._mode = _Mode.NORMAL |
| 935 | self.wire_mode_ended.emit() |
| 936 | if committed: |
| 937 | self._sync_junctions() |
| 938 | self._remove_short_circuit_wires() |
| 939 | self._sync_junctions() |
| 940 | |
| 941 | def _refresh_preview(self, cursor: QPointF | None): |
| 942 | self._last_cursor = cursor |
no test coverage detected