QskArcMetrics::toAbsolute version with qreal added
This commit is contained in:
parent
98cb1b256b
commit
76248e480b
@ -73,17 +73,27 @@ QVariant QskArcMetrics::interpolate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
QskArcMetrics QskArcMetrics::toAbsolute( const QSizeF& size ) const noexcept
|
QskArcMetrics QskArcMetrics::toAbsolute( const QSizeF& size ) const noexcept
|
||||||
|
{
|
||||||
|
if ( size.width() < 0.0 )
|
||||||
|
return toAbsolute( size.height() );
|
||||||
|
|
||||||
|
if ( size.height() < 0.0 )
|
||||||
|
return toAbsolute( size.width() );
|
||||||
|
|
||||||
|
return toAbsolute( qMin( size.width(), size.height() ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
QskArcMetrics QskArcMetrics::toAbsolute( qreal size ) const noexcept
|
||||||
{
|
{
|
||||||
if ( m_sizeMode != Qt::RelativeSize )
|
if ( m_sizeMode != Qt::RelativeSize )
|
||||||
return *this;
|
return *this;
|
||||||
|
|
||||||
QskArcMetrics absoluted = *this;
|
QskArcMetrics absoluted = *this;
|
||||||
|
|
||||||
const auto l = qMin( size.width(), size.height() );
|
if ( size <= 0.0 )
|
||||||
if ( l <= 0.0 )
|
|
||||||
absoluted.m_thickness = 0.0;
|
absoluted.m_thickness = 0.0;
|
||||||
else
|
else
|
||||||
absoluted.m_thickness = qskAbsoluted( l, absoluted.m_thickness );
|
absoluted.m_thickness = qskAbsoluted( size, absoluted.m_thickness );
|
||||||
|
|
||||||
absoluted.m_sizeMode = Qt::AbsoluteSize;
|
absoluted.m_sizeMode = Qt::AbsoluteSize;
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@ class QSK_EXPORT QskArcMetrics
|
|||||||
qreal value ) const noexcept;
|
qreal value ) const noexcept;
|
||||||
|
|
||||||
QskArcMetrics toAbsolute( const QSizeF& ) const noexcept;
|
QskArcMetrics toAbsolute( const QSizeF& ) const noexcept;
|
||||||
|
QskArcMetrics toAbsolute( qreal ) const noexcept;
|
||||||
|
|
||||||
QskHashValue hash( QskHashValue seed = 0 ) const noexcept;
|
QskHashValue hash( QskHashValue seed = 0 ) const noexcept;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user