18QSK_EXPORT QRect qskAlignedRect(
const QRect& outerRect,
19 int width,
int height, Qt::Alignment alignment );
21QSK_EXPORT QRectF qskAlignedRectF(
const QRectF& outerRect,
22 qreal width, qreal height, Qt::Alignment alignment );
24QSK_EXPORT QRect qskInnerRect(
const QRectF& rect );
25QSK_EXPORT QRectF qskInnerRectF(
const QRectF& rect );
27QSK_EXPORT QRectF qskValidOrEmptyInnerRect(
28 const QRectF& rect,
const QMarginsF& margins );
30QSK_EXPORT qreal qskHorizontalAdvance(
const QFont&,
const QString& );
31QSK_EXPORT qreal qskHorizontalAdvance(
const QFontMetricsF&,
const QString& );
32QSK_EXPORT QSizeF qskTextRenderSize(
const QFontMetricsF&,
const QString& );
34QSK_EXPORT QRectF qskInterpolatedRect(
35 const QRectF& from,
const QRectF& to, qreal progress );
37QSK_EXPORT QSizeF qskInterpolatedSize(
38 const QSizeF& from,
const QSizeF& to, qreal progress );
40inline QRect qskAlignedRect(
const QRect& outerRect,
41 const QSize& size, Qt::Alignment alignment )
43 return qskAlignedRect( outerRect, size.width(), size.height(), alignment );
46inline QRectF qskAlignedRectF(
const QRectF& outerRect,
47 const QSizeF& size, Qt::Alignment alignment )
49 return qskAlignedRectF( outerRect, size.width(), size.height(), alignment );
52inline constexpr QMarginsF qskMargins(
const QRectF& rect,
const QRectF& innerRect )
55 innerRect.left() - rect.left(),
56 innerRect.top() - rect.top(),
57 rect.right() - innerRect.right(),
58 rect.bottom() - innerRect.bottom() );
61inline constexpr bool qskFuzzyCompare( qreal value1, qreal value2 )
63 if ( qFuzzyIsNull( value1 ) )
64 return qFuzzyIsNull( value2 );
66 if ( qFuzzyIsNull( value2 ) )
69 return qFuzzyCompare( value1, value2 );
72QSK_EXPORT qreal qskFuzzyFloor( qreal value, qreal stepSize );
73QSK_EXPORT qreal qskFuzzyCeil( qreal value, qreal stepSize );
75QSK_EXPORT
double qskConstrainedDegrees(
double );
76QSK_EXPORT
float qskConstrainedDegrees(
float );
78QSK_EXPORT
double qskConstrainedRadians(
double );
79QSK_EXPORT
float qskConstrainedRadians(
float );