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:
parent
3922f468b4
commit
ebc5a6c638
1 changed files with 8 additions and 0 deletions
|
@ -187,6 +187,14 @@ enum EffectFrameStyle {
|
|||
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
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue