Skip to content

Commit 66e1fc3

Browse files
adjust backdrop node and force redraw to make pyside6 compatible
1 parent 387a507 commit 66e1fc3

File tree

1 file changed

+14
-9
lines changed

1 file changed

+14
-9
lines changed

NodeGraphQt/qgraphics/node_backdrop.py

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/usr/bin/python
2-
from Qt import QtGui, QtCore, QtWidgets
2+
from Qt import QtCore, QtGui, QtWidgets
33

44
from NodeGraphQt.constants import Z_VAL_BACKDROP, NodeEnum
55
from NodeGraphQt.qgraphics.node_abstract import AbstractNodeItem
@@ -79,10 +79,12 @@ def paint(self, painter, option, widget):
7979

8080
margin = 1.0
8181
rect = self.boundingRect()
82-
rect = QtCore.QRectF(rect.left() + margin,
83-
rect.top() + margin,
84-
rect.width() - (margin * 2),
85-
rect.height() - (margin * 2))
82+
rect = QtCore.QRectF(
83+
rect.left() + margin,
84+
rect.top() + margin,
85+
rect.width() - (margin * 2),
86+
rect.height() - (margin * 2),
87+
)
8688

8789
item = self.parentItem()
8890
if item and item.selected:
@@ -159,6 +161,7 @@ def mouseReleaseEvent(self, event):
159161
def on_sizer_pos_changed(self, pos):
160162
self._width = pos.x() + self._sizer.size
161163
self._height = pos.y() + self._sizer.size
164+
self.update()
162165

163166
def on_sizer_pos_mouse_release(self):
164167
size = {
@@ -189,10 +192,12 @@ def paint(self, painter, option, widget):
189192

190193
margin = 1.0
191194
rect = self.boundingRect()
192-
rect = QtCore.QRectF(rect.left() + margin,
193-
rect.top() + margin,
194-
rect.width() - (margin * 2),
195-
rect.height() - (margin * 2))
195+
rect = QtCore.QRectF(
196+
rect.left() + margin,
197+
rect.top() + margin,
198+
rect.width() - (margin * 2),
199+
rect.height() - (margin * 2),
200+
)
196201

197202
radius = 2.6
198203
color = (self.color[0], self.color[1], self.color[2], 50)

0 commit comments

Comments
 (0)