Code smell & performance improvement : Capture large object "watermarkData" by reference.

This commit is contained in:
Yann Lossouarn 2024-02-23 18:34:20 +01:00
parent 7ff8aed6bc
commit eea5dca893

View File

@ -167,7 +167,7 @@ void VPGraphicsTileGrid::paint(QPainter *painter, const QStyleOptionGraphicsItem
VWatermarkData const watermarkData = layout->TileFactory()->WatermarkData(); VWatermarkData const watermarkData = layout->TileFactory()->WatermarkData();
auto PaintWatermark = [painter, layout, xScale, yScale, watermarkData](const QRectF &img) auto PaintWatermark = [painter, layout, xScale, yScale, &watermarkData](const QRectF &img)
{ {
if (not layout->LayoutSettings().WatermarkPath().isEmpty() && layout->LayoutSettings().GetShowWatermark() && if (not layout->LayoutSettings().WatermarkPath().isEmpty() && layout->LayoutSettings().GetShowWatermark() &&
watermarkData.opacity > 0) watermarkData.opacity > 0)