From 61104cd43c91feadb51f28ea16c2a33e6de74756 Mon Sep 17 00:00:00 2001 From: Kenneth Lyons Date: Tue, 24 Dec 2019 10:04:31 -0800 Subject: [PATCH] Fix small oversight in LegendItem --- pyqtgraph/graphicsItems/LegendItem.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/pyqtgraph/graphicsItems/LegendItem.py b/pyqtgraph/graphicsItems/LegendItem.py index d8986011..5c3083a2 100644 --- a/pyqtgraph/graphicsItems/LegendItem.py +++ b/pyqtgraph/graphicsItems/LegendItem.py @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- from .GraphicsWidget import GraphicsWidget from .LabelItem import LabelItem from ..Qt import QtGui, QtCore @@ -123,7 +124,7 @@ class LegendItem(GraphicsWidget, GraphicsWidgetAnchor): def setParentItem(self, p): ret = GraphicsWidget.setParentItem(self, p) - if self.offset is not None: + if self.opts['offset'] is not None: offset = Point(self.opts['offset']) anchorx = 1 if offset[0] <= 0 else 0 anchory = 1 if offset[1] <= 0 else 0 @@ -251,7 +252,3 @@ class ItemSample(GraphicsWidget): p.translate(10, 10) path = drawSymbol(p, symbol, size, pen, brush) - - - -