(self)
| 156 | # ── bounding rect ───────────────────────────────────────────────────────── |
| 157 | |
| 158 | def boundingRect(self) -> QRectF: |
| 159 | br = super().boundingRect() |
| 160 | m = HANDLE_SIZE / 2.0 |
| 161 | br = br.adjusted(-m, -m, m, m) |
| 162 | if self._net_label is not None and self._net_label.isVisible() and self.points: |
| 163 | br = br.united(self._net_label.mapRectToParent(self._net_label.boundingRect())) |
| 164 | anchor = self.points[0] |
| 165 | lbl_pos = self._net_label.pos() |
| 166 | m = 3.0 |
| 167 | br = br.united(QRectF( |
| 168 | min(anchor.x(), lbl_pos.x()) - m, |
| 169 | min(anchor.y(), lbl_pos.y()) - m, |
| 170 | abs(anchor.x() - lbl_pos.x()) + 2 * m, |
| 171 | abs(anchor.y() - lbl_pos.y()) + 2 * m, |
| 172 | )) |
| 173 | return br |
| 174 | |
| 175 | # ── hit testing ─────────────────────────────────────────────────────────── |
| 176 |
no outgoing calls
no test coverage detected