MCPcopy Create free account
hub / github.com/KDE/labplot / recalcShapeAndBoundingRect

Method recalcShapeAndBoundingRect

src/backend/worksheet/TextLabel.cpp:1001–1014  ·  view source on GitHub ↗

! recalculates the outer bounds and the shape of the label. */

Source from the content-addressed store, hash-verified

999 recalculates the outer bounds and the shape of the label.
1000*/
1001void 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
1016void TextLabelPrivate::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget*) {
1017 if (positionInvalid || textWrapper.text.isEmpty())

Callers 1

initMethod · 0.45

Calls 1

boundingRectMethod · 0.45

Tested by

no test coverage detected