From 9a892fcab05603cbb716191361bc98df0a00d890 Mon Sep 17 00:00:00 2001 From: Waldo Bastian Date: Tue, 16 Sep 2014 03:23:29 +0200 Subject: Fix zoom in TQTextEdit TQTextEdit::zoomIn / TQTextEdit::zoomOut does not work if the original font had its size specified in pixels instead of points. pointSize() returns 0 in such case. --- src/widgets/qtextedit.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/widgets/qtextedit.cpp b/src/widgets/qtextedit.cpp index 9507d4f08..67703f342 100644 --- a/src/widgets/qtextedit.cpp +++ b/src/widgets/qtextedit.cpp @@ -5774,7 +5774,12 @@ void TQTextEdit::setFont( const TQFont &f ) void TQTextEdit::zoomIn( int range ) { TQFont f( TQScrollView::font() ); - f.setPointSize( TQFontInfo(f).pointSize() + range ); + TQFontInfo fi(f); + if (fi.pointSize() <= 0) { + f.setPixelSize( fi.pixelSize() + range ); + } else { + f.setPointSize( fi.pointSize() + range ); + } setFont( f ); } @@ -5789,7 +5794,12 @@ void TQTextEdit::zoomIn( int range ) void TQTextEdit::zoomOut( int range ) { TQFont f( TQScrollView::font() ); - f.setPointSize( TQMAX( 1, TQFontInfo(f).pointSize() - range ) ); + TQFontInfo fi(f); + if (fi.pointSize() <= 0) { + f.setPixelSize( TQMAX( 1, fi.pixelSize() - range ) ); + } else { + f.setPointSize( TQMAX( 1, fi.pointSize() - range ) ); + } setFont( f ); } -- cgit v1.2.1