causality inference done
This commit is contained in:
@@ -27,7 +27,7 @@ class ConnectionStyle:
|
||||
# This is the intentional code-level styling point for every port/connection type.
|
||||
CONNECTION_STYLES: dict[str, ConnectionStyle] = {
|
||||
"signal": ConnectionStyle(),
|
||||
"power": ConnectionStyle(width=3.0, arrow_style="half", color="#000000"),
|
||||
"power": ConnectionStyle(width=3.0, arrow_style="half", color="#000000", arrow_size=20.0),
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -397,6 +397,19 @@ class ConnectionGraphicsItem(QGraphicsPathItem):
|
||||
self.name_label: NameLabelItem | None = None
|
||||
self.sync_name_label(connection)
|
||||
|
||||
def boundingRect(self) -> QRectF: # noqa: N802
|
||||
"""Include custom arrowheads and causality marks in Qt's repaint area."""
|
||||
|
||||
decoration_margin = (
|
||||
max(self.style.arrow_size, 6.0) + self.style.selected_width / 2 + 1.0
|
||||
)
|
||||
return super().boundingRect().adjusted(
|
||||
-decoration_margin,
|
||||
-decoration_margin,
|
||||
decoration_margin,
|
||||
decoration_margin,
|
||||
)
|
||||
|
||||
def sync_name_label(self, connection: Connection) -> None:
|
||||
visible = bool(connection.properties.get("showName", False))
|
||||
if not visible:
|
||||
|
||||
Reference in New Issue
Block a user