Try to fix boundingRect of GroupItem by ignoring boundingRect of text child

This commit is contained in:
Mika Fischer
2012-01-27 14:00:06 +01:00
parent 15f7abe8b0
commit 5eecfd6789
+7 -2
View File
@@ -433,7 +433,12 @@ class GroupItem(BaseItem):
BaseItem.setColor(self, *args, **kwargs)
def boundingRect(self):
return self.childrenBoundingRect()
br = QRectF()
for item in self.childItems():
if item is self._text_item:
continue
br |= item.mapRectToParent(item.boundingRect())
return br
class OccludablePointItem(PointItem):
@@ -536,7 +541,7 @@ class NPointFaceItem(GroupItem):
self._children.append(child)
def boundingRect(self):
br = self.childrenBoundingRect()
br = GroupItem.boundingRect(self)
offset = 0.2 * br.height()
return br.adjusted(-offset, -offset, +offset, +offset)