! recalculates the outer bounds and the shape of the label. */
| 278 | recalculates the outer bounds and the shape of the label. |
| 279 | */ |
| 280 | void ImagePrivate::recalcShapeAndBoundingRect() { |
| 281 | prepareGeometryChange(); |
| 282 | |
| 283 | QTransform matrix; |
| 284 | imageShape = QPainterPath(); |
| 285 | if (borderLine->pen().style() != Qt::NoPen) { |
| 286 | imageShape.addPath(WorksheetElement::shapeFromPath(borderShapePath, borderLine->pen())); |
| 287 | transformedBoundingRectangle = matrix.mapRect(imageShape.boundingRect()); |
| 288 | } else { |
| 289 | imageShape.addRect(m_boundingRectangle); |
| 290 | transformedBoundingRectangle = matrix.mapRect(m_boundingRectangle); |
| 291 | } |
| 292 | |
| 293 | imageShape = matrix.map(imageShape); |
| 294 | |
| 295 | Q_EMIT q->changed(); |
| 296 | } |
| 297 | |
| 298 | void ImagePrivate::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget*) { |
| 299 | painter->save(); |
no test coverage detected