diff options
-rw-r--r-- | src/widgets/qtextedit.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/src/widgets/qtextedit.cpp b/src/widgets/qtextedit.cpp index 2171e75..f2a4a91 100644 --- a/src/widgets/qtextedit.cpp +++ b/src/widgets/qtextedit.cpp @@ -5774,7 +5774,12 @@ void QTextEdit::setFont( const QFont &f ) void QTextEdit::zoomIn( int range ) { QFont f( QScrollView::font() ); - f.setPointSize( QFontInfo(f).pointSize() + range ); + QFontInfo fi(f); + if (fi.pointSize() <= 0) { + f.setPixelSize( fi.pixelSize() + range ); + } else { + f.setPointSize( fi.pointSize() + range ); + } setFont( f ); } @@ -5789,7 +5794,12 @@ void QTextEdit::zoomIn( int range ) void QTextEdit::zoomOut( int range ) { QFont f( QScrollView::font() ); - f.setPointSize( QMAX( 1, QFontInfo(f).pointSize() - range ) ); + QFontInfo fi(f); + if (fi.pointSize() <= 0) { + f.setPixelSize( QMAX( 1, fi.pixelSize() - range ) ); + } else { + f.setPointSize( QMAX( 1, fi.pointSize() - range ) ); + } setFont( f ); } |