Add scaledRect as a helper function to scale a QRectF by a scalar

I have no idea why QRectF doesn't have this...
This commit is contained in:
Arjen Hiemstra 2022-08-04 11:46:08 +02:00
parent 3922f468b4
commit ebc5a6c638

View file

@ -187,6 +187,14 @@ enum EffectFrameStyle {
EffectFrameStyled ///< Displays a Plasma-styled frame around the contents. EffectFrameStyled ///< Displays a Plasma-styled frame around the contents.
}; };
/**
* Scale a rect by a scalar.
*/
KWINEFFECTS_EXPORT inline QRectF scaledRect(const QRectF &rect, qreal scale)
{
return QRectF{rect.x() * scale, rect.y() * scale, rect.width() * scale, rect.height() * scale};
}
/** /**
* @short Base class for all KWin effects * @short Base class for all KWin effects
* *