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

Method recalcShapeAndBoundingRect

src/backend/worksheet/Image.cpp:280–296  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

278 recalculates the outer bounds and the shape of the label.
279*/
280void 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
298void ImagePrivate::paint(QPainter* painter, const QStyleOptionGraphicsItem* /*option*/, QWidget*) {
299 painter->save();

Callers 1

initMethod · 0.45

Calls 2

boundingRectMethod · 0.45
mapMethod · 0.45

Tested by

no test coverage detected