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

Method recalcShapeAndBoundingRect

src/backend/worksheet/plots/cartesian/Histogram.cpp:1461–1491  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1459 recalculates the outer bounds and the shape of the curve.
1460 */
1461void HistogramPrivate::recalcShapeAndBoundingRect() {
1462 if (suppressRecalc)
1463 return;
1464
1465 prepareGeometryChange();
1466 m_shape = QPainterPath();
1467 if (line->histogramLineType() != Histogram::NoLine)
1468 m_shape.addPath(WorksheetElement::shapeFromPath(linePath, line->pen()));
1469
1470 if (symbol->style() != Symbol::Style::NoSymbols)
1471 m_shape.addPath(symbolsPath);
1472
1473 if (value->type() != Value::NoValues)
1474 m_shape.addPath(valuesPath);
1475
1476 if (errorBar->yErrorType() != ErrorBar::ErrorType::NoError)
1477 m_shape.addPath(WorksheetElement::shapeFromPath(errorBarsPath, errorBar->line()->pen()));
1478
1479 m_shape.addPath(rugPath);
1480 m_shape.addPolygon(fillPolygon);
1481
1482 m_boundingRectangle = m_shape.boundingRect();
1483 m_boundingRectangle = m_boundingRectangle.united(fillPolygon.boundingRect());
1484
1485 // TODO: when the selection is painted, line intersections are visible.
1486 // simplified() removes those artifacts but is horrible slow for curves with large number of points.
1487 // search for an alternative.
1488 // m_shape = m_shape.simplified();
1489
1490 updatePixmap();
1491}
1492
1493void HistogramPrivate::draw(QPainter* painter) {
1494 PERFTRACE(name() + QLatin1String(Q_FUNC_INFO));

Callers 2

initMethod · 0.45
loadThemeConfigMethod · 0.45

Calls 3

typeMethod · 0.45
lineMethod · 0.45
boundingRectMethod · 0.45

Tested by

no test coverage detected