diff --git a/src/libkwineffects/kwineffects.h b/src/libkwineffects/kwineffects.h index d99be81f20..fa4be72e4d 100644 --- a/src/libkwineffects/kwineffects.h +++ b/src/libkwineffects/kwineffects.h @@ -38,6 +38,7 @@ #include #include +#include #include #include @@ -196,6 +197,14 @@ KWINEFFECTS_EXPORT inline QRectF scaledRect(const QRectF &rect, qreal scale) return QRectF{rect.x() * scale, rect.y() * scale, rect.width() * scale, rect.height() * scale}; } +/** + * Round a vector to nearest integer. + */ +KWINEFFECTS_EXPORT inline QVector2D roundVector(const QVector2D &input) +{ + return QVector2D(std::round(input.x()), std::round(input.y())); +} + /** * @short Base class for all KWin effects *