Skip to content

Commit 4922c07

Browse files
committed
Fixed obvious things in untested code from QwtStyleSheetRecorder class
This closes #47, closes #48 and closes #52
1 parent a546278 commit 4922c07

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

qwt/plot_canvas.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def updateState(self, state):
5858

5959
def drawRects(self, rects, count):
6060
for i in range(count):
61-
self.border.rectList += rects[i]
61+
self.border.rectList += [rects[i]]
6262

6363
def drawPath(self, path):
6464
rect = QRectF(QPointF(0., 0.), self.__size)
@@ -765,10 +765,10 @@ def updateStyleSheetInfo(self):
765765
opt.initFrom(self)
766766
self.style().drawPrimitive(QStyle.PE_Widget, opt, painter, self)
767767
painter.end()
768-
self.__data.styleSheet.hasBorder = not recorder.border.rectList.isEmpty()
768+
self.__data.styleSheet.hasBorder = len(recorder.border.rectList) > 0
769769
self.__data.styleSheet.cornerRects = recorder.clipRects
770770
if recorder.background.path.isEmpty():
771-
if not recorder.border.rectList.isEmpty():
771+
if self.__data.styleSheet.hasBorder:
772772
self.__data.styleSheet.borderPath =\
773773
qwtCombinePathList(self.rect(), recorder.border.pathlist)
774774
else:
@@ -796,7 +796,7 @@ def borderPath(self, rect):
796796
painter.end()
797797
if not recorder.background.path.isEmpty():
798798
return recorder.background.path
799-
if not recorder.border.rectList.isEmpty():
799+
if len(recorder.border.rectList) > 0:
800800
return qwtCombinePathList(rect, recorder.border.pathlist)
801801
elif self.__data.borderRadius > 0.:
802802
fw2 = self.frameWidth()*.5

0 commit comments

Comments
 (0)