mirror of
https://github.com/wassname/sloth.git
synced 2026-06-30 22:55:15 +08:00
Try to fix boundingRect of GroupItem by ignoring boundingRect of text child
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user