styles: port away from QRegion::rects()
Use begin()/end() instead. Drop the special handling of rectCount() == 1, since with begin()/end(), we no longer take the hit of creating a QVector just to be able to return it from rects(). Change-Id: I19ebc38267951c80bc71aa9d2b5df7403d710064 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>bb10
parent
634344411e
commit
6fd1895900
|
|
@ -760,10 +760,8 @@ static QRegion scaleRegion(const QRegion ®ion, qreal factor)
|
|||
{
|
||||
if (region.isEmpty() || qFuzzyCompare(factor, qreal(1)))
|
||||
return region;
|
||||
if (region.rectCount() == 1)
|
||||
return QRegion(scaleRect(QRectF(region.boundingRect()), factor).toRect());
|
||||
QRegion result;
|
||||
foreach (const QRect &rect, region.rects())
|
||||
for (const QRect &rect : region)
|
||||
result += QRectF(QPointF(rect.topLeft()) * factor, QSizeF(rect.size() * factor)).toRect();
|
||||
return result;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue