toAbsolute using width or height
This commit is contained in:
parent
56e94d01cf
commit
2bfc8ee9f9
|
@ -73,21 +73,13 @@ QskArcMetrics QskArcMetrics::toAbsolute( const QSizeF& size ) const noexcept
|
||||||
if ( m_sizeMode != Qt::RelativeSize )
|
if ( m_sizeMode != Qt::RelativeSize )
|
||||||
return *this;
|
return *this;
|
||||||
|
|
||||||
/*
|
|
||||||
Being relative to what - TODO ?
|
|
||||||
I can imagine arcs being relative to other arcs !!!
|
|
||||||
*/
|
|
||||||
|
|
||||||
QskArcMetrics absoluted = *this;
|
QskArcMetrics absoluted = *this;
|
||||||
|
|
||||||
if ( size.isEmpty() )
|
const auto l = qMin( size.width(), size.height() );
|
||||||
{
|
if ( l <= 0.0 )
|
||||||
absoluted.m_width = 0;
|
absoluted.m_width = 0.0;
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
absoluted.m_width = qskAbsoluted( l, absoluted.m_width );
|
||||||
absoluted.m_width = qskAbsoluted( size.width(), absoluted.m_width );
|
|
||||||
}
|
|
||||||
|
|
||||||
absoluted.m_sizeMode = Qt::AbsoluteSize;
|
absoluted.m_sizeMode = Qt::AbsoluteSize;
|
||||||
|
|
||||||
|
@ -113,11 +105,9 @@ QDebug operator<<( QDebug debug, const QskArcMetrics& metrics )
|
||||||
QDebugStateSaver saver( debug );
|
QDebugStateSaver saver( debug );
|
||||||
debug.nospace();
|
debug.nospace();
|
||||||
|
|
||||||
debug << "Arc" << '(';
|
debug << "QskArcMetrics" << '(';
|
||||||
debug << "width:" << metrics.width();
|
debug << metrics.width() << ',' << metrics.sizeMode();
|
||||||
debug << ", start angle:" << metrics.startAngle();
|
debug << ",[" << metrics.startAngle() << ',' << metrics.spanAngle() << ']';
|
||||||
debug << ", span angle:" << metrics.spanAngle();
|
|
||||||
debug << ", size mode:" << metrics.sizeMode();
|
|
||||||
debug << ')';
|
debug << ')';
|
||||||
|
|
||||||
return debug;
|
return debug;
|
||||||
|
|
Loading…
Reference in New Issue