Code smell improvement: capture 'matrix' by reference instead of capturing by value

This commit is contained in:
Yann Lossouarn 2024-02-23 18:21:40 +01:00
parent b0b451eabd
commit 932db63497

View File

@ -809,7 +809,7 @@ void VPGraphicsPiece::PaintInternalPaths(QPainter *painter, const VPPiecePtr &pi
QVector<VLayoutPoint> points = piecePath.Points(); QVector<VLayoutPoint> points = piecePath.Points();
const QTransform matrix = VGObject::FlippingMatrix(piece->GetSeamMirrorLine()); const QTransform matrix = VGObject::FlippingMatrix(piece->GetSeamMirrorLine());
std::transform(points.begin(), points.end(), points.begin(), std::transform(points.begin(), points.end(), points.begin(),
[matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); }); [&matrix](const VLayoutPoint &point) { return VAbstractPiece::MapPoint(point, matrix); });
QVector<QPointF> casted; QVector<QPointF> casted;
CastTo(points, casted); CastTo(points, casted);
path.addPath(piece->GetMatrix().map(VPiecePath::MakePainterPath(casted))); path.addPath(piece->GetMatrix().map(VPiecePath::MakePainterPath(casted)));