From a7d51aefe4f8cca342f6990311ca0c511256b075 Mon Sep 17 00:00:00 2001 From: Mika Fischer Date: Thu, 30 Jun 2011 14:47:14 +0200 Subject: [PATCH] Allow RectItems with zero width or height --- sloth/items/items.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sloth/items/items.py b/sloth/items/items.py index 6f223cd..0d966da 100644 --- a/sloth/items/items.py +++ b/sloth/items/items.py @@ -1,6 +1,8 @@ from PyQt4.QtGui import * from PyQt4.Qt import * +import logging +LOG = logging.getLogger(__name__) class BaseItem(QAbstractGraphicsShapeItem): """ @@ -227,6 +229,7 @@ class RectItem(BaseItem): self.rect_ = None self._updateRect(self._dataToRect(self._model_item)) + LOG.debug("Constructed rect %s for model item %s" % (self.rect_, model_item)) def __call__(self, model_item=None, parent=None): item = RectItem(model_item, parent) @@ -241,8 +244,6 @@ class RectItem(BaseItem): float(model_item['width']), float(model_item['height'])) def _updateRect(self, rect): - if not rect.isValid(): - return if rect == self.rect_: return