Small fixes and bigger library

This commit is contained in:
Joppe Blondel
2026-08-18 14:22:01 +02:00
parent 60a30d4ee3
commit 1d535c1f5b
21 changed files with 935 additions and 41 deletions
+3 -2
View File
@@ -162,7 +162,6 @@ class GraphComponentItem(QGraphicsPixmapItem):
def mousePressEvent(self, event: QGraphicsSceneMouseEvent) -> None:
if event.button() == Qt.MouseButton.LeftButton and self.editor.mode is GraphEditorMode.CONNECTION:
self.editor.choose_connection_component(self.component_id, event.screenPos())
event.accept()
return
self._drag_start = QPointF(self.pos())
@@ -171,6 +170,8 @@ class GraphComponentItem(QGraphicsPixmapItem):
def mouseReleaseEvent(self, event: QGraphicsSceneMouseEvent) -> None:
if self.editor.mode is GraphEditorMode.CONNECTION:
if event.button() == Qt.MouseButton.LeftButton:
self.editor.choose_connection_component(self.component_id, event.screenPos())
event.accept()
return
super().mouseReleaseEvent(event)
@@ -723,7 +724,7 @@ class GraphEditorWidget(QWidget):
@staticmethod
def _port_available(port_id: PortID, port: Port, used_ports: set[PortID]) -> bool:
if isinstance(port, SignalPort):
return port.direction is SignalDirection.OUTPUT or port_id not in used_ports
return port.direction is SignalDirection.OUTPUT or port.multiplicity or port_id not in used_ports
if isinstance(port, BondPort):
return port.multiplicity or port_id not in used_ports
return False