heightForWidth/widthForHeight added
This commit is contained in:
parent
2cd9c79fa7
commit
2b84276019
@ -578,6 +578,24 @@ QSizeF QskGraphic::defaultSize() const
|
||||
return boundingRect().size();
|
||||
}
|
||||
|
||||
qreal QskGraphic::heightForWidth( qreal width ) const
|
||||
{
|
||||
const auto sz = defaultSize();
|
||||
if ( sz.isEmpty() )
|
||||
return 0;
|
||||
|
||||
return sz.height() * width / sz.width();
|
||||
}
|
||||
|
||||
qreal QskGraphic::widthForHeight( qreal height ) const
|
||||
{
|
||||
const auto sz = defaultSize();
|
||||
if ( sz.isEmpty() )
|
||||
return 0;
|
||||
|
||||
return sz.width() * height / sz.height();
|
||||
}
|
||||
|
||||
void QskGraphic::render( QPainter* painter ) const
|
||||
{
|
||||
render( painter, QskColorFilter() );
|
||||
|
@ -88,6 +88,9 @@ class QSK_EXPORT QskGraphic : public QPaintDevice
|
||||
void setDefaultSize( const QSizeF& );
|
||||
QSizeF defaultSize() const;
|
||||
|
||||
qreal heightForWidth( qreal width ) const;
|
||||
qreal widthForHeight( qreal height ) const;
|
||||
|
||||
void setRenderHint( RenderHint, bool on = true );
|
||||
bool testRenderHint( RenderHint ) const;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user