Skip to content

Commit 771665e

Browse files
committed
doc string updates.
1 parent 35192a1 commit 771665e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

NodeGraphQt/widgets/viewer.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,9 @@ def scale(self, sx, sy, pos=None):
157157
self._update_scene()
158158

159159
def _update_scene(self):
160+
"""
161+
Redraw the scene.
162+
"""
160163
self.setSceneRect(self._scene_range)
161164
self.fitInView(self._scene_range, QtCore.Qt.KeepAspectRatio)
162165

@@ -1048,10 +1051,25 @@ def scene_rect(self):
10481051
self._scene_range.width(), self._scene_range.height()]
10491052

10501053
def scene_center(self):
1054+
"""
1055+
Get the center x,y pos from the scene.
1056+
1057+
Returns:
1058+
list[float]: x, y position.
1059+
"""
10511060
cent = self._scene_range.center()
10521061
return [cent.x(), cent.y()]
10531062

10541063
def nodes_rect_center(self, nodes):
1064+
"""
1065+
Get the center x,y pos from the specified nodes.
1066+
1067+
Args:
1068+
nodes (list[AbstractNodeItem]): list of node qgrphics items.
1069+
1070+
Returns:
1071+
list[float]: x, y position.
1072+
"""
10551073
cent = self._combined_rect(nodes).center()
10561074
return [cent.x(), cent.y()]
10571075

0 commit comments

Comments
 (0)