node_edge_snapping Module¶
A module containing the Edge Snapping functions which are used in QDMGraphicsView class.
-
class
nodeeditor.node_edge_snapping.EdgeSnapping(grView: QGraphicsView, snapping_radius: float = 24)¶ Bases:
object-
getSnappedSocketItem(event: QMouseEvent) → QDMGraphicsSocket¶ Returns
QDMGraphicsSocketwhich we should snap to
-
getSnappedToSocketPosition(scenepos: PyQt5.QtCore.QPointF) -> ('QDMGraphicsSocket', <class 'PyQt5.QtCore.QPointF'>)¶ Returns grSocket and Scene position to nearest Socket or original position if no nearby Socket found
- Parameters
scenepos (
QPointF) – From which point should I snap?- Returns
grSocket and Scene postion to nearest socket
-