--- a/Snapshot/SnapshotFreehandGrabber.py Fri Nov 01 15:48:48 2013 +0100 +++ b/Snapshot/SnapshotFreehandGrabber.py Sun Nov 03 15:58:22 2013 +0100 @@ -168,9 +168,9 @@ boundingRect = textRect.adjusted(-4, 0, 0, 0) polBoundingRect = pol.boundingRect() - if (textRect.width() < + if (textRect.width() < polBoundingRect.width() - 2 * self.__handleSize) and \ - (textRect.height() < + (textRect.height() < polBoundingRect.height() - 2 * self.__handleSize) and \ polBoundingRect.width() > 100 and \ polBoundingRect.height() > 100: @@ -178,7 +178,7 @@ boundingRect.moveCenter(polBoundingRect.center()) textRect.moveCenter(polBoundingRect.center()) elif polBoundingRect.y() - 3 > textRect.height() and \ - polBoundingRect.x() + textRect.width() < self.rect().width(): + polBoundingRect.x() + textRect.width() < self.rect().width(): # on top, left aligned boundingRect.moveBottomLeft( QPoint(polBoundingRect.x(), polBoundingRect.y() - 3)) @@ -190,9 +190,9 @@ QPoint(polBoundingRect.x() - 3, polBoundingRect.y())) textRect.moveTopRight( QPoint(polBoundingRect.x() - 5, polBoundingRect.y())) - elif (polBoundingRect.bottom() + 3 + textRect.height() < + elif (polBoundingRect.bottom() + 3 + textRect.height() < self.rect().bottom()) and \ - polBoundingRect.right() > textRect.width(): + polBoundingRect.right() > textRect.width(): # at bottom, right aligned boundingRect.moveTopRight( QPoint(polBoundingRect.right(), polBoundingRect.bottom() + 3)) @@ -212,7 +212,7 @@ drawPolygon(painter, boundingRect, textColor, textBackgroundColor) painter.drawText(textRect, Qt.AlignHCenter, txt) - if (polBoundingRect.height() > self.__handleSize * 2 and \ + if (polBoundingRect.height() > self.__handleSize * 2 and polBoundingRect.width() > self.__handleSize * 2) or \ not self.__mouseDown: painter.setBrush(Qt.transparent) @@ -327,8 +327,8 @@ pt.begin(pixmap2) if pt.paintEngine().hasFeature(QPaintEngine.PorterDuff): pt.setRenderHints( - QPainter.Antialiasing | \ - QPainter.HighQualityAntialiasing | \ + QPainter.Antialiasing | + QPainter.HighQualityAntialiasing | QPainter.SmoothPixmapTransform, True) pt.setBrush(Qt.black)