! recalculates the outer bounds and the shape of the label. */
| 999 | recalculates the outer bounds and the shape of the label. |
| 1000 | */ |
| 1001 | void TextLabelPrivate::recalcShapeAndBoundingRect() { |
| 1002 | prepareGeometryChange(); |
| 1003 | |
| 1004 | labelShape = QPainterPath(); |
| 1005 | if (borderShape != TextLabel::BorderShape::NoBorder) { |
| 1006 | labelShape.addPath(WorksheetElement::shapeFromPath(borderShapePath, borderLine->pen())); |
| 1007 | m_boundingRectangle = labelShape.boundingRect(); |
| 1008 | } else { |
| 1009 | labelShape.addRect(boundingRectangleText); |
| 1010 | m_boundingRectangle = boundingRectangleText; |
| 1011 | } |
| 1012 | |
| 1013 | Q_EMIT q->changed(); |
| 1014 | } |
| 1015 | |
| 1016 | void TextLabelPrivate::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget*) { |
| 1017 | if (positionInvalid || textWrapper.text.isEmpty()) |