--- a/eric7/Graphics/PackageItem.py Sat Dec 04 11:49:27 2021 +0100 +++ b/eric7/Graphics/PackageItem.py Sat Dec 04 15:34:40 2021 +0100 @@ -102,14 +102,14 @@ modules = self.model.getModules() - x = self.margin + self.rect().x() - y = self.margin + self.rect().y() + x = self.margin + int(self.rect().x()) + y = self.margin + int(self.rect().y()) self.header = QGraphicsSimpleTextItem(self) self.header.setBrush(self._colors[0]) self.header.setFont(boldFont) self.header.setText(self.model.getName()) self.header.setPos(x, y) - y += self.header.boundingRect().height() + self.margin + y += int(self.header.boundingRect().height()) + self.margin if not self.noModules: if modules: @@ -131,20 +131,21 @@ if self.model is None: return - width = self.header.boundingRect().width() - height = self.header.boundingRect().height() + width = int(self.header.boundingRect().width()) + height = int(self.header.boundingRect().height()) if self.modules: - width = max(width, self.modules.boundingRect().width()) - height += self.modules.boundingRect().height() + width = max(width, + int(self.modules.boundingRect().width())) + height += int(self.modules.boundingRect().height()) latchW = width / 3.0 latchH = min(15.0, latchW) self.setSize(width + 2 * self.margin, height + latchH + 2 * self.margin) - x = self.margin + self.rect().x() - y = self.margin + self.rect().y() + latchH + x = self.margin + int(self.rect().x()) + y = self.margin + int(self.rect().y()) + latchH self.header.setPos(x, y) - y += self.header.boundingRect().height() + self.margin + y += int(self.header.boundingRect().height()) + self.margin if self.modules: self.modules.setPos(x, y) @@ -184,20 +185,20 @@ else: pen.setWidth(1) - offsetX = self.rect().x() - offsetY = self.rect().y() - w = self.rect().width() + offsetX = int(self.rect().x()) + offsetY = int(self.rect().y()) + w = int(self.rect().width()) latchW = w / 3.0 latchH = min(15.0, latchW) - h = self.rect().height() - latchH + 1 + h = int(self.rect().height() - latchH + 1) painter.setPen(pen) painter.setBrush(self.brush()) painter.setFont(self.font) - painter.drawRect(offsetX, offsetY, latchW, latchH) - painter.drawRect(offsetX, offsetY + latchH, w, h) - y = self.margin + self.header.boundingRect().height() + latchH + painter.drawRect(offsetX, offsetY, int(latchW), int(latchH)) + painter.drawRect(offsetX, offsetY + int(latchH), w, h) + y = int(self.margin + self.header.boundingRect().height() + latchH) painter.drawLine(offsetX, offsetY + y, offsetX + w - 1, offsetY + y) self.adjustAssociations()